Benchmarks for the same ASN.1 structures encoded/decoded with cryptography, pyasn1, and asn1crypto.
The benchmark covers:
- a small RSA private key sequence
- a
Doohickiessequence with primitive fields, object identifiers, and a set of generalized times
The decode benchmarks are named decode_access_one_field because the timed function decodes the DER input and accesses one child field. This is intentional: asn1crypto lazily loads child fields, so timing only load() would measure construction of the lazy wrapper rather than comparable field access.
The asn1crypto encode benchmark uses normal cached dump(), not dump(force=True).
Run from this directory with uv. Dependencies are declared inline in the test file:
uv run test_asn1_benchmark.py --benchmark-sort=mean