Last active
August 20, 2020 09:44
-
-
Save doom369/804c9bca242e04afd40b78aa731a3331 to your computer and use it in GitHub Desktop.
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
@BenchmarkMode(Mode.AverageTime) | |
@Fork(1) | |
@State(Scope.Thread) | |
@Warmup(iterations = 5, time = 1) | |
@OutputTimeUnit(TimeUnit.NANOSECONDS) | |
@Measurement(iterations = 10, time = 1) | |
public class EnumValueOf { | |
@Param({"LABEL", "ON_LABEL", "MAX"}) | |
String strParams; | |
@Benchmark | |
public WidgetProperty enumValueOf() { | |
return WidgetProperty.valueOf(strParams); | |
} | |
@Benchmark | |
public WidgetProperty enumSwitch() { | |
return WidgetProperty.valueOfSwitch(strParams); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment