Skip to content

Conversation

@erykwalder
Copy link
Contributor

Before:

BenchmarkEncodeInt64     5000000           301 ns/op
BenchmarkEncodeFloat64   2000000           892 ns/op
BenchmarkEncodeBool  5000000           255 ns/op

After:

BenchmarkEncodeInt64    10000000           128 ns/op
BenchmarkEncodeFloat64   5000000           266 ns/op
BenchmarkEncodeBool 10000000           124 ns/op

Relatively minor performance wins, but I thought I'd see what others thought.

encode.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Elsewhere we use strconv.AppendBool(). We should probably do one or the other, not both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated benchmark:

BenchmarkEncodeBool 10000000           124 ns/op

@johto
Copy link
Contributor

johto commented Apr 8, 2015

Looks great. I'll merge this after #351.

@johto
Copy link
Contributor

johto commented Apr 18, 2015

Pushed in 8910d1c. Thanks!

@johto johto closed this Apr 18, 2015
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.

3 participants