Skip to content

Instantly share code, notes, and snippets.

View doom369's full-sized avatar
🛴
Working from home

Dmytro Dumanskiy doom369

🛴
Working from home
View GitHub Profile
JDK 11.0.8, OpenJDK 64-Bit Server VM, 11.0.8+10
```
Benchmark (value) Mode Cnt Score Error Units
RemoveChar.remove avgt 10 4.405 ± 1.646 ns/op
RemoveChar.remove somePathNoDoT avgt 10 7.820 ± 0.296 ns/op
RemoveChar.remove some.Path.With.Dot avgt 10 92.185 ± 3.752 ns/op
RemoveChar.removeApache avgt 10 3.708 ± 0.070 ns/op
RemoveChar.removeApache somePathNoDoT avgt 10 10.018 ± 0.103 ns/op
@BenchmarkMode(Mode.AverageTime)
@Fork(5)
@State(Scope.Thread)
@Warmup(iterations = 5, time = 1)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Measurement(iterations = 10, time = 1)
public class EnumValueOf {
String[] names;
int index;
JDK 11.0.8, OpenJDK 64-Bit Server VM, 11.0.8+10
```
Benchmark Mode Cnt Score Error Units
EnumValueOf.enumMap avgt 50 7.800 ± 0.097 ns/op
EnumValueOf.enumSwitch avgt 50 19.734 ± 0.350 ns/op
EnumValueOf.enumValueOf avgt 50 9.292 ± 0.826 ns/op
```