-
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
Improve performance of immutable maps #1720
Conversation
I like that What is the performance impact? |
My measurements against the query service in the Without the changes in this PR:
With the changes:
|
After fixing the cut-and-paste bug in the recursive call things look better: ~18% improvement.
|
Thats a bit better! |
I've discovered that we are spending 10% of the app time ... parsing unicode while hashing
An unsafe casting to a bytes cuts down another 10% CPU:
|
"github.com/ugorji/go/codec" | ||
"github.com/weaveworks/ps" |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Other than one comment, LGTM |
} | ||
return LatestMap{out} | ||
} | ||
|
||
// CodecEncodeSelf implements codec.Selfer | ||
func (m *LatestMap) CodecEncodeSelf(encoder *codec.Encoder) { | ||
if m.Map != nil { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
You probably meant to |
I forgot to commit it, thanks |
* Allocate all map entries of the intermadiate representation at once * Use UnsafeMutableMap to improve performance of LatestMap construction * Remove gob encoder/decoder
Once vendored, LGTM. |
Improves #1010 #1457 #971