Skip to content

Add JMH benchmark subproject for HashSet vs BitSet performance comparison#323

Draft
Copilot wants to merge 4 commits into
masterfrom
copilot/add-benchmark-tests-for-hashset-vs-bitset
Draft

Add JMH benchmark subproject for HashSet vs BitSet performance comparison#323
Copilot wants to merge 4 commits into
masterfrom
copilot/add-benchmark-tests-for-hashset-vs-bitset

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 12, 2026

Adds comprehensive JMH benchmarks to quantify performance characteristics of the custom BitSet implementation against standard HashSet across common use cases.

Changes

  • New benchmarks Maven module with JMH 1.37, configured to produce standalone executable JAR via Maven Shade plugin
  • Six benchmark classes covering operation types:
    • SetAddBenchmark - insertion performance
    • SetContainsBenchmark - lookup performance
    • SetIterationBenchmark - traversal performance
    • SetRemoveBenchmark - deletion performance
    • SetMemoryBenchmark - allocation patterns with GC profiling
    • SetMixedOperationsBenchmark - realistic workload simulation
  • Parameterized tests across data sizes (100, 1K, 10K, 100K elements) and fill ratios (50%, 90%)
  • Documentation in benchmarks/README.md covering execution, profilers, and result interpretation

Usage

mvn package -pl benchmarks -am
java -jar benchmarks/target/benchmarks.jar

# Specific benchmark with custom parameters
java -jar benchmarks/target/benchmarks.jar SetAddBenchmark -p size=10000 -p fillRatio=0.9

# With GC profiler
java -jar benchmarks/target/benchmarks.jar -prof gc

Notes

  • Java 21 required for benchmark module (overrides parent POM's Java 25 target)
  • Initial test run shows ~7.6x speedup for BitSet add operations on small datasets
  • All benchmarks use fixed random seed (42) for reproducibility

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 12, 2026 00:39
Co-authored-by: rmartinsanta <55482385+rmartinsanta@users.noreply.github.com>
Co-authored-by: rmartinsanta <55482385+rmartinsanta@users.noreply.github.com>
Co-authored-by: rmartinsanta <55482385+rmartinsanta@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Maven subproject for benchmarking HashSet and BitSet Add JMH benchmark subproject for HashSet vs BitSet performance comparison Feb 12, 2026
Copilot AI requested a review from rmartinsanta February 12, 2026 00:46
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.

2 participants