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

faster VarintSize() #282

Merged
merged 1 commit into from
Oct 10, 2019
Merged

Conversation

rickyyangz
Copy link
Contributor

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

encoder.go Outdated Show resolved Hide resolved
Copy link

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK -- do we need to handle any cases when i < 0?

@tac0turtle tac0turtle merged commit fbf7762 into tendermint:master Oct 10, 2019
tac0turtle pushed a commit that referenced this pull request Oct 10, 2019
danil-lashin added a commit to MinterTeam/go-amino that referenced this pull request Nov 13, 2019
* tendermint-release/v0.15.1:
  remove changelog entry
  changelog fix
  cherry2
  cherry
  faster VarintSize() (tendermint#282)
  RC-1 0.16

# Conflicts:
#	amino_test.go
#	encoder.go
@ebuchman
Copy link
Contributor

Awesome, but

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

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.

6 participants