This file contains hidden or 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
Benchmark (strParams) Mode Cnt Score Error Units | |
EmptyStringEquals.equalsPost avgt 10 4.240 ± 0.058 ns/op | |
EmptyStringEquals.nonNullAndIsEmpty avgt 10 2.985 ± 0.048 ns/op | |
EmptyStringEquals.preEquals avgt 10 4.243 ± 0.062 ns/op | |
EmptyStringEquals.equalsPost nonEmptyString avgt 10 3.522 ± 0.034 ns/op | |
EmptyStringEquals.nonNullAndIsEmpty nonEmptyString avgt 10 2.894 ± 0.048 ns/op | |
EmptyStringEquals.preEquals nonEmptyString avgt 10 3.672 ± 0.016 ns/op |
This file contains hidden or 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 EmptyStringEquals { | |
@Param({"", "nonEmptyString"}) | |
private String strParams; |
This file contains hidden or 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
public static void main(String[] args) { | |
double average = 0; | |
int count = 0; | |
for (int i = 0; i < 1_000_000; i++) { | |
average += enhance(10, 15, Scroll.REGULAR); | |
count++; | |
} | |
System.out.println("Average : " + average / count); | |
average = 0; |
NewerOlder