Skip to content

Encoding speedups for strings and bools#77

Open
crast wants to merge 1 commit into
elodina:masterfrom
crast:encoder-speedups
Open

Encoding speedups for strings and bools#77
crast wants to merge 1 commit into
elodina:masterfrom
crast:encoder-speedups

Conversation

@crast

@crast crast commented Jun 4, 2016

Copy link
Copy Markdown
Contributor

Some speedups on string and boolean encoding primarily by reducing the amount of allocations required, thus reducing gc garbage as well. The string encoding speedup was pretty significant, because it saves an extra copy of the whole string, so the longer the string the better the speedup, but even on short strings you get 21.66% speedup.

String results:

$ benchcmp a.txt b.txt 
benchmark                              old ns/op     new ns/op     delta
BenchmarkStringSerialization_small     157           123           -21.66%
BenchmarkStringSerialization_med       181           126           -30.39%
BenchmarkStringSerialization_large     730           186           -74.52%

Boolean results:

$ benchcmp a.txt b.txt 
benchmark                           old ns/op     new ns/op     delta
BenchmarkBooleanSerialization-4     36.3          21.8          -39.94%

* 20%-75%+ speedup on string encoding and reduce GC garbage
* About a 40% speedup on bool encoding and reduce GC garbage
@crast crast force-pushed the encoder-speedups branch from 562c08c to 512532b Compare June 5, 2016 21:46
@crast

crast commented Aug 4, 2016

Copy link
Copy Markdown
Contributor Author

ping

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.

1 participant