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

Remove for loop from getFieldPathForName #428

Merged
merged 4 commits into from
Oct 2, 2023

Conversation

Ektaros
Copy link
Contributor

@Ektaros Ektaros commented Oct 2, 2023

This PR removes for loops from getFieldPathForName by introducing new map to serializer which helps to find fields by their name.
This results in ~25% faster parsing. Here are numbers from my machine for current master:
File size: 81 MB
Elapsed: 3.665982666s
File size: 107 MB
Elapsed: 4.7228615s
File size: 159 MB
Elapsed: 10.646743625s

And here is this branch results:
File size: 81 MB
Elapsed: 2.72868975s
File size: 107 MB
Elapsed: 3.623294709s
File size: 159 MB
Elapsed: 7.519242125s

@markus-wa
Copy link
Owner

very nice! great stuff @Ektaros 🥳

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (b70c827) 80.11% compared to head (9e0d8e4) 80.17%.

❗ Current head 9e0d8e4 differs from pull request most recent head b8a4f97. Consider uploading reports for the commit b8a4f97 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #428      +/-   ##
==========================================
+ Coverage   80.11%   80.17%   +0.05%     
==========================================
  Files          47       47              
  Lines        6165     6168       +3     
==========================================
+ Hits         4939     4945       +6     
+ Misses       1017     1016       -1     
+ Partials      209      207       -2     
Files Coverage Δ
pkg/demoinfocs/sendtables2/parser.go 84.33% <100.00%> (ø)
pkg/demoinfocs/sendtables2/serializer.go 59.52% <100.00%> (+14.36%) ⬆️

... and 3 files with indirect coverage changes

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

@markus-wa markus-wa merged commit 28a80ab into markus-wa:master Oct 2, 2023
3 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.

None yet

2 participants