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 Endpoint benchmarks #465

Merged
merged 1 commit into from
Nov 24, 2015
Merged

Conversation

vkostyukov
Copy link
Collaborator

Put a very initial version of endpoint benchamakrs as well as went ahead and picked some low-hanging fruits in terms of reducing allocations (using something called TooFastString):

For matcher:

Before:

[info] MatcherBenchmark.stringSome                      avgt   20    34.758 ±   6.150   ns/op
[info] MatcherBenchmark.stringSome:·gc.alloc.rate.norm  avgt   20   120.000 ±   0.001    B/op

After:

[info] MatcherBenchmark.stringSome                      avgt   20    29.877 ±   2.720   ns/op
[info] MatcherBenchmark.stringSome:·gc.alloc.rate.norm  avgt   20   112.000 ±   7.127    B/op

For extractors

Before:

[info] Benchmark                                           Mode  Cnt     Score     Error   Units
[info] ExtractorBenchmark.booleanNone                      avgt   20  1601.956 ±  86.425   ns/op
[info] ExtractorBenchmark.booleanNone:·gc.alloc.rate.norm  avgt   20   592.001 ±   0.002    B/op
[info] ExtractorBenchmark.booleanSome                      avgt   20    70.483 ±   2.892   ns/op
[info] ExtractorBenchmark.booleanSome:·gc.alloc.rate.norm  avgt   20   240.000 ±   0.001    B/op
[info] ExtractorBenchmark.intNone                          avgt   20  1978.250 ± 239.277   ns/op
[info] ExtractorBenchmark.intNone:·gc.alloc.rate.norm      avgt   20   472.001 ±   0.002    B/op
[info] ExtractorBenchmark.intSome                          avgt   20    93.216 ±   3.607   ns/op
[info] ExtractorBenchmark.intSome:·gc.alloc.rate.norm      avgt   20   240.000 ±   0.001    B/op
[info] ExtractorBenchmark.stringSome                       avgt   20    52.364 ±   3.661   ns/op
[info] ExtractorBenchmark.stringSome:·gc.alloc.rate.norm   avgt   20   224.000 ±   0.001    B/op


After:

After:
[info] Benchmark                                           Mode  Cnt     Score     Error   Units
[info] ExtractorBenchmark.booleanNone                      avgt   20    14.859 ±   3.604   ns/op
[info] ExtractorBenchmark.booleanNone:·gc.alloc.rate.norm  avgt   20    24.000 ±   0.001    B/op
[info] ExtractorBenchmark.booleanSome                      avgt   20    69.588 ±  13.004   ns/op
[info] ExtractorBenchmark.booleanSome:·gc.alloc.rate.norm  avgt   20   224.000 ±   0.001    B/op
[info] ExtractorBenchmark.intNone                          avgt   20    57.572 ±   9.569   ns/op
[info] ExtractorBenchmark.intNone:·gc.alloc.rate.norm      avgt   20   120.000 ±   0.001    B/op
[info] ExtractorBenchmark.intSome                          avgt   20    70.062 ±   3.525   ns/op
[info] ExtractorBenchmark.intSome:·gc.alloc.rate.norm      avgt   20   256.000 ±   0.001    B/op
[info] ExtractorBenchmark.stringSome                       avgt   20    71.432 ±   6.939   ns/op
[info] ExtractorBenchmark.stringSome:·gc.alloc.rate.norm   avgt   20   200.000 ±   0.001    B/op

Note extra 16 bytes per intSome: the cost of a closure (option mapping) in .map(_.toInt).

@vkostyukov vkostyukov force-pushed the vkostyukov/endpoint-benchmakrs branch 3 times, most recently from e339616 to 3b34be0 Compare November 22, 2015 08:14
@codecov-io
Copy link

Current coverage is 78.12%

Merging #465 into master will decrease coverage by -15.94% as of b17a3bd

Powered by Codecov. Updated on successful CI builds.

@vkostyukov vkostyukov force-pushed the vkostyukov/endpoint-benchmakrs branch 4 times, most recently from 5a72d80 to 80f0afd Compare November 23, 2015 00:13
vkostyukov added a commit that referenced this pull request Nov 24, 2015
@vkostyukov vkostyukov merged commit b49a910 into master Nov 24, 2015
@vkostyukov vkostyukov deleted the vkostyukov/endpoint-benchmakrs branch November 24, 2015 06:48
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