Skip to content

Conversation

@anderseknert
Copy link
Member

This was something I originally intended to use in another project, but since this turned out to be a better implementation (subject of course to review!) in terms of both performance and simplicity, I figured we might as well use it here too. Some changes include:

  • MustParse to parse known valid versions
  • Allocates nothing in any operations other than 1 alloc in String()
  • Ignores empty PreRelease and Metadata fields in serialization
  • encoding.TextAppender implementation to serialize without allocating
  • A whole bunch of benchmarks

@netlify
Copy link

netlify bot commented Nov 3, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit ae43df8
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/6909b17ab06aa200082dfd21
😎 Deploy Preview https://deploy-preview-8010--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@anderseknert anderseknert force-pushed the new-semver branch 3 times, most recently from be31dd3 to dddea4d Compare November 3, 2025 13:46
This was something I originally intended to use in another project,
but since this turned out to be a better implementation (subject of
course to review!) in terms of both performance and simplicity, I
figured we might as well use it here too. Some changes include:

- `MustParse` to parse known valid versions
- Allocates nothing in any operations other than 1 alloc in `String()`
- Ignores empty `PreRelease` and `Metadata` fields in serialization
- `encoding.TextAppender` implementation to serialize without allocating
- A whole bunch of benchmarks

Signed-off-by: Anders Eknert <[email protected]>
@anderseknert anderseknert merged commit 30d3346 into open-policy-agent:main Nov 4, 2025
31 checks passed
@anderseknert anderseknert deleted the new-semver branch November 4, 2025 08:10
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