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

Decode via byte slice for memcache and file read #2331

Merged
merged 2 commits into from
Mar 14, 2017
Merged

Conversation

bboreham
Copy link
Collaborator

@bboreham bboreham commented Mar 14, 2017

This is more efficient, since the decoder can read field names in-place.
It also appears to be absolutely faster.

On master, decoding 75 reports from file, totalling 16MB compressed:

real	0m27.566s
user	0m26.432s
sys	0m1.312s

On this branch, calling NewDecoderBytes but not updating the msgpack libarary:

real	0m23.569s
user	0m22.764s
sys	0m1.172s

And, if you update the msgpack library so it actually does the in-place reading:

real	0m22.710s
user	0m21.820s
sys	0m1.328s

Note readReport decompresses rather than having ReadBytes do it, to avoid creating an intermediate copy of the entire compressed file.

This is more efficient, since the decoder can read field names in-place.
It also appears to be absolutely faster.
@bboreham bboreham force-pushed the decode-byte-slice branch from 3a4657c to b085c80 Compare March 14, 2017 14:54
@bboreham bboreham merged commit 2fe3216 into master Mar 14, 2017
@bboreham bboreham deleted the decode-byte-slice branch March 14, 2017 15:43
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