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

Increase parsing and comparison performance #17

Merged
merged 9 commits into from
Nov 23, 2023
Merged

Increase parsing and comparison performance #17

merged 9 commits into from
Nov 23, 2023

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Nov 20, 2023

This patch does a lot of performance improvement by inlining hot paths and by reducing memory pressure removing unneeded allocation.

Before:

BenchmarkVersionParser-12         188611     7715 ns/op     8557 B/op    51 allocs/op
BenchmarkVersionComparator-12      74793    17347 ns/op        0 B/op     0 allocs/op

After:

BenchmarkVersionParser-12         479626     3719 ns/op      616 B/op    51 allocs/op (+154% !!)
BenchmarkVersionComparator-12     101772    11720 ns/op        0 B/op     0 allocs/op (+36%)

@cmaglie cmaglie self-assigned this Nov 20, 2023
@cmaglie cmaglie added the enhancement New feature or request label Nov 20, 2023
Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8f4804c) 100.00% compared to head (fee3392) 100.00%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##            master       #17    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           11        11            
  Lines          858      1015   +157     
==========================================
+ Hits           858      1015   +157     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@alessio-perugini alessio-perugini left a comment

Choose a reason for hiding this comment

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

@cmaglie cmaglie merged commit b4bf3c6 into master Nov 23, 2023
5 checks passed
@cmaglie cmaglie deleted the performance branch November 23, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants