-
Notifications
You must be signed in to change notification settings - Fork 712
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
Map decode optimisations #2364
Map decode optimisations #2364
Conversation
f239b71
to
46d1705
Compare
What's the performance improvement? |
Same test as in #2351: With this PR, commit 46d1705:
Compare against 1.652: |
Note CI failed because you run the unit-tests before running the code-generation step. |
Uhm, could the new code generation dependency have messed up coveralls? |
The problem is that you weren't testing the right code before. |
OK, fair enough |
1d71e21
to
3d5bc63
Compare
Rebased so we don't see the two commits already merged. Sorry, should have done that earlier. |
This avoids a runtime type lookup, so goes a little faster. Also having less recursion makes it easier to interpret profiles.
04acaa5
to
f629ccb
Compare
Tests failed sometimes with a "panic: Not run on same source!" message from
I suspect this is caused by Also rebased just now. |
'codecgen' embeds a random integer in each identifier; this means code coverage across different CircleCI lanes may not match. Here we force the integer to 23 on every CircleCI build so they always match.
f629ccb
to
97dda94
Compare
This is branched after #2351, so look at that one first.
Here I apply the the map-reading code taken from
LatestMap
to other uses ofps.Map
; this removes the indirection via a Go map and consequent copying.Also call
CodecDecodeSelf()
instead ofDecode()
where possible: this avoids a runtime type lookup, so goes a little faster. I had to get a little funky with providing an implementation for the parser to run before the real codec code is generated; that is the purpose ofdummySelfer
.Bonus: having less recursion through
Decode()
makes it easier to interpret profiles.