container_image_dist_ref
A docker/OCI image reference parser.
This library is extensively tested against the authoritative image reference implementation, https://github.com/distribution/reference.
Motivation
I wanted to use distribution/reference
in a rust project, but didn't want to deal with FFI into go
.
Goals
- fidelity to the
distribution/reference
's parser - fun optimizations!
More about these goals and design choices in ./ARCHITECTURE.md
.
Benchmarks
Based on some naive benchmarking, this library achieves at least a 10x speedup compared to distribution/reference.
#!/bin/bash
( # go
&&
)
distribution/reference:
goos: linux
goarch: amd64
pkg: github.com/skalt/container_image_dist_ref/internal/reference_oracle
cpu: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
BenchmarkOracleEntireTestSuite-8 9218 148438 ns/op
This crate:
entire_test_suite time: [5.0737 µs 5.1349 µs 5.2047 µs]
speedup = (148438 ns) / ((5.1349 µs) * (1000 ns / µs)) = 28.908