Skip to content

Commit

Permalink
Adding benchmarks for size 10 and 100
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Dec 27, 2024
1 parent 6273121 commit 09386ba
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,16 @@ complicate n (0.up_to n).to_vector+initial
this.arrayOfFibNumbers = getMethod.apply("slice").execute(self, 0, vec, 1, length);
break;
}
case "averageOverSliceWrapped":
case "averageOverSliceWrapped10":
{
this.arrayOfFibNumbers = getMethod.apply("slice").execute(self, 10, vec, 1, length);
break;
}
case "averageOverSliceWrapped100":
{
this.arrayOfFibNumbers = getMethod.apply("slice").execute(self, 100, vec, 1, length);
break;
}
case "averageOverArray":
{
this.arrayOfFibNumbers = getMethod.apply("to_array").execute(self, vec);
Expand Down Expand Up @@ -161,13 +166,21 @@ public void averageOverVector(Blackhole matter) {
performBenchmark(matter);
}

/** Measures performance of a single {@code Vector.slice}. */
@Benchmark
public void averageOverSlice(Blackhole matter) {
performBenchmark(matter);
}

/** Measures performance of {@code Vector.slice} applied ten times on the same array. */
@Benchmark
public void averageOverSliceWrapped10(Blackhole matter) {
performBenchmark(matter);
}

/** Measures performance of {@code Vector.slice} applied hundred times on the same array. */
@Benchmark
public void averageOverSliceWrapped(Blackhole matter) {
public void averageOverSliceWrapped100(Blackhole matter) {
performBenchmark(matter);
}

Expand Down

0 comments on commit 09386ba

Please sign in to comment.