Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x.encoding.asn1: another minor cleanup #22968

Merged
merged 8 commits into from
Nov 25, 2024
Merged

Conversation

blackshirt
Copy link
Contributor

@blackshirt blackshirt commented Nov 25, 2024

This PR is rather of
follow-up from previous PR in attempt to improves x.encoding.asn1 module, as availables in 22948, 22932, 22861, and 22847 PRs.
This PR contains some small changes to the module:

  • Refinement to align with the latest fix of Option unwrapping. (mostly from @felipensp, thank guys)
  • Just removes .str() from sequence and set for now, its needed to allow just dump current sequence fields.
  • Unifies some of RawElement methods
  • Some small refinements.

The latest bench run with -prod flag results in

Benchmarking ASN.1 encode...
Average example encode time: 1 µs
Benchmarking ASN.1 decode (with asn1.decode)...
Average (asn1.decode) decode time: 1 µs
Benchmarking ASN.1 decode with Example.decode)...
Average (Example.decode) decode time: 1 µs

Its likely on par with the go version bench availables on bench dir. The previous patch help reduces some overhead of it.

Huly®: V_0.6-21409

@blackshirt blackshirt changed the title Asn1 cleanup The other series of x.encoding.asn1 cleanup Nov 25, 2024
@blackshirt blackshirt changed the title The other series of x.encoding.asn1 cleanup The other series of x.encoding.asn1 module cleanup Nov 25, 2024
@blackshirt blackshirt changed the title The other series of x.encoding.asn1 module cleanup x.encoding.asn1: another minor cleanup Nov 25, 2024
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.
Less code, more performance 🥳 !

@spytheman spytheman merged commit 9490582 into vlang:master Nov 25, 2024
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants