-
Notifications
You must be signed in to change notification settings - Fork 144
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
Replace Buffer with Uint8Array #452
base: master
Are you sure you want to change the base?
Conversation
ab64683
to
dc4a675
Compare
Thanks @valadaptive! I'll try to find time to merge #428. |
FYI @valadaptive - #428 is in. |
3e4bce6
to
6870ee6
Compare
It seems to be slower than just using Uint8Array.slice, since subarray is so expensive to call.
This should assist in optimizing writeString properly, allowing both long and short string encoding performance to be benchmarked while still prioritizing short strings.
This took some fiddling but it's now *faster* than the previous implementation.
This should now work if Buffer is not defined
6f39bde
to
bd70cce
Compare
Working on removing |
I still need to do some cleanups and replace uses of
Buffer.compare
, but I'm putting this PR here so you can benchmark it. Before I can complete this, #428 (minus the version bump) should be merged in, as the services code usesBuffer
everywhere and expects fixed/bytes types to decode toBuffer
s.I've made some tweaks to the benchmarking setup, so comparing this directly to the master branch won't work:
ArrayFloat
benchmark to go along withArrayDouble
.--expose-gc
flag when benchmarking in order to manually trigger garbage collection between benches, hopefully making results more consistent.Tap#writeString
, since it only generated strings up to a length of 32.I've cherry-picked those benchmarking changes into the bench-tweaks branch, which you can use to compare benchmarks.