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

Investigate Benchmarks #6

Open
prataprc opened this issue Jun 21, 2017 · 1 comment
Open

Investigate Benchmarks #6

prataprc opened this issue Jun 21, 2017 · 1 comment
Labels

Comments

@prataprc
Copy link
Member

BenchmarkVal2CollMap 50000 26696 ns/op 16416 B/op 2 allocs/op
BenchmarkVal2CollTyp 10000 174548 ns/op 49250 B/op 6 allocs/op

BenchmarkJson2CollStr 2000 635015 ns/op 1048647 B/op 5 allocs/op

BenchmarkCbor2CollMap 2000 787087 ns/op 1089654 B/op 8 allocs/op
BenchmarkCbor2CollTyp 500 2500523 ns/op 3269067 B/op 25 allocs/op

@prataprc
Copy link
Member Author

strconv.AppendFloat, and, strconv.AppendInt avoid heap allocations, lowering
the memory pressure, hence suitable for tight loops. Except that, it does
appen() on the input byte-slice hence the slice itself escapes to heap. So
there is still 1 allocation that can't be avoided.

In case of CollateIint64 and CollateFloat64, there is an allocation for each call to AppendFloat/AppendInt.

Above benchmarks are on data that has integers and floats. So, we can't have a true ZERO allocation API to convert float to string and int to string.

@prataprc prataprc added the task label Jun 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant