-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #499 from fthomas/topic/improve-unsafeFrom
Improve performance of RefinedType#unsafeFrom
- Loading branch information
Showing
4 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
modules/benchmark/src/main/scala/eu/timepit/refined/benchmark/PosIntBenchmark.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package eu.timepit.refined.benchmark | ||
|
||
import eu.timepit.refined.types.numeric.PosInt | ||
import java.util.concurrent.TimeUnit | ||
import org.openjdk.jmh.annotations.{Benchmark, BenchmarkMode, Mode, OutputTimeUnit} | ||
|
||
@BenchmarkMode(Array(Mode.AverageTime)) | ||
class PosIntBenchmark { | ||
|
||
@Benchmark | ||
@OutputTimeUnit(TimeUnit.NANOSECONDS) | ||
def unsafeFrom_1: Any = | ||
PosInt.unsafeFrom(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.0") | ||
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.3") |