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

add handle benchmarks #4

Merged
merged 1 commit into from
Feb 9, 2015
Merged

add handle benchmarks #4

merged 1 commit into from
Feb 9, 2015

Conversation

rogpeppe
Copy link
Contributor

@rogpeppe rogpeppe commented Feb 9, 2015

We add a few benchmarks to give us an idea of the costs of this approach
in its various forms. The "Trad" benchmarks show the base cost of the
non-reflective approach.

BenchmarkUnmarshal2Fields                  1000000      1951 ns/op      80 B/op       3 allocs/op
BenchmarkHandle2FieldsTrad                 1000000      1357 ns/op     280 B/op       6 allocs/op
BenchmarkHandle2Fields                      300000      5451 ns/op     504 B/op      11 allocs/op
BenchmarkHandle2FieldsUnmarshalOnly         500000      4047 ns/op     392 B/op      10 allocs/op
BenchmarkUnmarshal4Fields                   500000      3765 ns/op     144 B/op       7 allocs/op
BenchmarkHandle4FieldsTrad                 1000000      1390 ns/op     280 B/op       6 allocs/op
BenchmarkHandle4Fields                      200000      7603 ns/op     616 B/op      15 allocs/op
BenchmarkHandle4FieldsUnmarshalOnly         300000      6060 ns/op     504 B/op      14 allocs/op
BenchmarkHandle2StringFields               1000000      1448 ns/op     176 B/op       4 allocs/op
BenchmarkHandle2StringFieldsUnmarshalOnly  3000000       490 ns/op      64 B/op       2 allocs/op
BenchmarkHandle2StringFieldsTrad          10000000       177 ns/op      32 B/op       1 allocs/op
BenchmarkHandle4StringFields               1000000      1673 ns/op     208 B/op       4 allocs/op
BenchmarkHandle4StringFieldsUnmarshalOnly  2000000       683 ns/op      96 B/op       2 allocs/op
BenchmarkHandle4StringFieldsTrad           5000000       246 ns/op      32 B/op       1 allocs/op
BenchmarkHandle8StringFields               1000000      2188 ns/op     272 B/op       4 allocs/op
BenchmarkHandle8StringFieldsUnmarshalOnly  1000000      1226 ns/op     160 B/op       2 allocs/op
BenchmarkHandle8StringFieldsTrad           3000000       472 ns/op      32 B/op       1 allocs/op
BenchmarkHandle16StringFields               500000      2882 ns/op     400 B/op       4 allocs/op
BenchmarkHandle16StringFieldsUnmarshalOnly 1000000      1950 ns/op     288 B/op       2 allocs/op
BenchmarkHandle16StringFieldsTrad          2000000       686 ns/op      32 B/op       1 allocs/op

@urosj
Copy link

urosj commented Feb 9, 2015

Could we add benchmark for some real-example json that we use in CS?

@urosj
Copy link

urosj commented Feb 9, 2015

Otherwise, 👍
Thank you for this!

@mhilton
Copy link
Contributor

mhilton commented Feb 9, 2015

👍 LGTM

@rogpeppe
Copy link
Contributor Author

rogpeppe commented Feb 9, 2015

Will add JSON benchmark in a subsequent PR.

rogpeppe added a commit that referenced this pull request Feb 9, 2015
@rogpeppe rogpeppe merged commit d6d1231 into juju:master Feb 9, 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