Skip to content

feat: refactor JMH benchmarks to isolate initialization overhead from measurements#496

Merged
hsluoyz merged 2 commits intomasterfrom
copilot/refactor-benchmark-setup-patterns
Jan 2, 2026
Merged

feat: refactor JMH benchmarks to isolate initialization overhead from measurements#496
hsluoyz merged 2 commits intomasterfrom
copilot/refactor-benchmark-setup-patterns

Conversation

Copy link
Contributor

Copilot AI commented Jan 2, 2026

fix: #495

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hsluoyz hsluoyz marked this pull request as ready for review January 2, 2026 13:00
@codecov-commenter
Copy link

codecov-commenter commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.91%. Comparing base (b334732) to head (120f453).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #496   +/-   ##
=======================================
  Coverage   67.91%   67.91%           
=======================================
  Files          63       63           
  Lines        3079     3079           
  Branches      573      573           
=======================================
  Hits         2091     2091           
  Misses        805      805           
  Partials      183      183           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Updated all benchmark classes to use @BenchmarkMode({Mode.Throughput, Mode.AverageTime})
- Changed @OutputTimeUnit to TimeUnit.MILLISECONDS
- Updated warmup iterations from 3 to 5
- Moved Enforcer/RoleManager initialization from benchmark methods to @setup(Level.Trial) methods
- Benchmark methods now only contain the actual operation being measured
- Updated main method configuration to use .forks(1), .warmupIterations(5), .measurementIterations(5)
- Changed .include() to use getSimpleName() instead of getName()

Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor benchmarks to use proper JMH state and setup patterns Refactor JMH benchmarks to isolate initialization overhead from measurements Jan 2, 2026
Copilot AI requested a review from hsluoyz January 2, 2026 13:10
@hsluoyz hsluoyz changed the title Refactor JMH benchmarks to isolate initialization overhead from measurements feat: refactor JMH benchmarks to isolate initialization overhead from measurements Jan 2, 2026
@hsluoyz hsluoyz merged commit e744d44 into master Jan 2, 2026
1 of 3 checks passed
hsluoyz pushed a commit that referenced this pull request Jan 2, 2026
AKonnyaku added a commit to AKonnyaku/jcasbin that referenced this pull request Jan 4, 2026
AKonnyaku added a commit to AKonnyaku/jcasbin that referenced this pull request Jan 10, 2026
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.

[refactor] Rewrite Benchmarks using proper JMH State and Setup patterns

4 participants