Skip to content

Add workshop exercise ContainsBenchmark - #2

Open
idueppe wants to merge 1 commit into
masterfrom
add-contains-benchmark-exercise
Open

idueppe wants to merge 1 commit into
masterfrom
add-contains-benchmark-exercise

Conversation

@idueppe

@idueppe idueppe commented Nov 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds io.crowdcode.java.benchmarks.exercise.ContainsBenchmark, an unfinished benchmark with five TODO markers for the JMH workshop exercise (ArrayList vs. HashSet contains()).
  • Documents the exercise in the README.

The class compiles as is, but has no @Benchmark method yet, so it is not listed by java -jar target/benchmarks.jar -l until participants complete it. The solution is intentionally not part of this repository.

Test

  • mvn clean package -DskipTests with JDK 17 succeeds with the skeleton.
  • With the solution applied, java -jar target/benchmarks.jar -f 1 -wi 3 -i 3 -w 1 -r 1 ContainsBenchmark runs all eight parameter combinations in about one minute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant