tendermint / go-amino

Protobuf3 with Interface support - Designed for blockchains (deterministic, upgradeable, fast, and compact)
Other
260 stars 84 forks source link

faster VarintSize() #282

Closed rickyyangz closed 4 years ago

rickyyangz commented 4 years ago

As I tested on my laptop,

the original one costs:

Benchmark_VarintSize-12     300000000            6.21 ns/op

the optimized one costs:

Benchmark_VarintSize2-12        2000000000           0.52 ns/op
ebuchman commented 4 years ago

Awesome, but

1) can we get a test for this, please? 2) is this even used anywhere?