Vector class more tests
This commit is contained in:
parent
64b205a6ce
commit
5dd6d52025
|
@ -49,6 +49,11 @@ public class ArrayListBenchmark {
|
|||
return state.employeeList.contains(state.employee);
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public boolean testContainsVector(ArrayListBenchmark.MyState state) {
|
||||
return state.employeeVector.contains(state.employee);
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public int testIndexOf(ArrayListBenchmark.MyState state) {
|
||||
return state.employeeList.indexOf(state.employee);
|
||||
|
@ -73,6 +78,11 @@ public class ArrayListBenchmark {
|
|||
state.employeeList.add(new Employee(state.iterations + 1, "John"));
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void testAddVector(ArrayListBenchmark.MyState state) {
|
||||
state.employeeVector.add(new Employee(state.iterations + 1, "John"));
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Options options = new OptionsBuilder()
|
||||
.include(ArrayListBenchmark.class.getSimpleName()).threads(1)
|
||||
|
|
Loading…
Reference in New Issue