Skip to content

Commit

Permalink
Sped up benchmarks (knative-extensions#3401)
Browse files Browse the repository at this point in the history
Signed-off-by: Calum Murray <cmurray@redhat.com>
  • Loading branch information
Cali0707 committed Oct 17, 2023
1 parent 204be08 commit 4168215
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public class AllFilterBenchmark {
public static ExactFilter makeExactFilter() {
return new ExactFilter(Map.of("id", "com.github.pull.create"));
return new ExactFilter(Map.of("type", "com.github.pull.create"));
}

public static PrefixFilter makePrefixFilter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static CloudEvent event() {
}

public static ExactFilter makeExactFilter() {
return new ExactFilter(Map.of("id", "com.github.pull.create"));
return new ExactFilter(Map.of("type", "com.github.pull.create"));
}

public static PrefixFilter makePrefixFilter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,22 @@
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;

@BenchmarkMode(Mode.All)
@BenchmarkMode(Mode.Throughput)
@Fork(1)
@State(Scope.Thread)
@Measurement(iterations = 3, time = 10)
@Warmup(iterations = 3, time = 5)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public abstract class FilterBenchmark {
Filter filter;
CloudEvent cloudEvent;

@Setup
@Setup(Level.Trial)
public void setupFilter() {
this.filter = createFilter();
}

@Setup
@Setup(Level.Trial)
public void setupCloudEvent() {
this.cloudEvent = createEvent();
}
Expand Down

0 comments on commit 4168215

Please sign in to comment.