Improve performance of RefinedType#unsafeFrom #499
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this change:
[info] Result
"eu.timepit.refined.benchmark.PosIntBenchmark.unsafeFrom_1":
[info] 23.575 ±(99.9%) 0.264 ns/op [Average]
[info] (min, avg, max) = (22.521, 23.575, 29.684), stdev = 1.119
[info] CI (99.9%): [23.311, 23.840] (assumes normal distribution)
[info] # Run complete. Total time: 00:06:43
[info] Benchmark Mode Cnt Score Error Units
[info] PosIntBenchmark.unsafeFrom_1 avgt 200 23.575 ± 0.264 ns/op
After this change:
[info] Result
"eu.timepit.refined.benchmark.PosIntBenchmark.unsafeFrom_1":
[info] 13.410 ±(99.9%) 0.076 ns/op [Average]
[info] (min, avg, max) = (12.855, 13.410, 14.228), stdev = 0.323
[info] CI (99.9%): [13.334, 13.487] (assumes normal distribution)
[info] # Run complete. Total time: 00:06:43
[info] Benchmark Mode Cnt Score Error Units
[info] PosIntBenchmark.unsafeFrom_1 avgt 200 13.410 ± 0.076 ns/op