Skip to content
CAI
Software that uses CAICheck a score

sbt/sbt-jmh

66.7

Adequate · 28 September 2026

212

lines of production code

Scala

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is an sbt plugin designed to integrate the Java Microbenchmark Harness (JMH) into Scala build workflows. It automates the generation of benchmark sources from annotations and manages JMH dependencies and configuration. The plugin supports both Scala 2 and Scala 3, ensuring compatibility across different sbt versions while providing isolated execution environments for accurate performance testing.

Features

Add sbt-jmh-tester with sample benchmarks and resource loading

The sbt-jmh-tester module has been added to provide a reference implementation for JMH benchmarking within the sbt ecosystem. It includes a sample Scala benchmark (TestBenchmark) that demonstrates performance testing for range operations, iterators, and file I/O, alongside a resource file (hello.txt) to validate that benchmark classes can correctly load resources via the classloader. The module is configured as an sbt auto-plugin, reading its JMH plugin version dynamically from the root project's version.sbt, and symlinks its build properties and JMH configuration to the root project to maintain synchronization.

sbt-jmh-tester · high confidence

Initial release of sbt-jmh plugin version 0.4.9-SNAPSHOT

This change introduces the initial project structure for the sbt-jmh plugin, establishing the baseline for version 0.4.9-SNAPSHOT. It adds the Apache 2.0 license, a .gitignore file to exclude build artifacts and IDE files, and a .java-version file specifying Java 1.8. The entry also includes the README.md documentation, which details how to enable the JmhPlugin auto-plugin in sbt builds, run benchmarks, and configure advanced options like custom runners and test class dependencies, alongside a version history table mapping plugin releases to their default JMH versions.

(repo-wide) · high confidence

Introduce sbt-jmh plugin with Jmh config and source generation

The plugin now defines a dedicated Jmh configuration that extends Test, providing settings for benchmark version, generator type (default, reflection, or asm), and bytecode directory. It adds a new task to generate JMH Java benchmark sources and resources, which scans the compile class directory for @Benchmark annotations and outputs generated code to the source managed directory. The plugin ensures proper classpath isolation by forking the JMH generator run and includes necessary JMH dependencies based on the selected generator type.

plugin/src/main/scala · high confidence

Behavioural changes

Added Scala 3 compatibility layer for the JMH plugin

The plugin now includes a new compatibility module (JmhPluginCompat) specifically for Scala 3, introducing adaptations for API changes in sbt 2 such as updated file conversion methods and the use of HashedVirtualFileRef. This allows the JMH plugin to function correctly when built with Scala 3 and sbt 2, ensuring backward compatibility with Scala 2 through a separate source directory.

plugin/src/main/scala-2, plugin/src/main/scala-3 · high confidence

Test coverage

Added sbt-jmh integration tests for bytecode directory, custom runners, and benchmark lifecycle

Added a suite of sbt-test fixtures for the sbt-jmh plugin to verify key behaviors: the \bytecode-directory\ test ensures that the \jmhBytecodeDirectory\ setting correctly isolates benchmark scanning so that classes in the default \src/main\ directory are ignored while \src/test\ benchmarks are detected; the \custom-runner\ test validates that users can execute benchmarks via a custom JMH \Runner\ and capture output to a file; the \delete-benchmark\ test confirms that removing a benchmark source file properly cleans up stale generated wrappers and compiled classes; and the \generator-error\ test ensures the build fails fast when the JMH generator encounters invalid sources.

plugin/src/sbt-test · high confidence

Dependencies

Update JMH version to 1.37

The default Java Microbenchmark Harness (JMH) version used by the plugin has been updated to 1.37, as defined in the new \sbt-jmh.properties\ configuration file. This ensures that benchmarking tasks utilize the latest stable JMH release.

plugin/src/main/resources · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 65 → 67 (+1.5)
  • Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.

Lenses

  • Code Health 99 → 99 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 54 → 57 (+3.1)
  • Readiness 73 → 73 (+0.0)
  • Security 65 → 65 (+0.0)

Resolved (2)

  • Documentation: no installation or build instructions (README.md)
  • Off-boarding risk: anonymized user #1

Changes since last survey

  • 3 commits — 2 feature/other, 1 fixes

By area

  • (repo) — 2 commits
  • plugin/src — 1 commit

Notable commits

  • fix: Merge pull request #359 from shawjef3/fix/issue-16-stale-generated-benchmarks
  • change: Clean up stale generated benchmarks after source deletion (#16)
  • change: Merge pull request #352 from sbt/update/sbt-pgp-2.3.2

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

sbt/sbt-jmh was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 23cf039d8cce60632024bad4c5fc40a14668d223 — the exact code this score is about.
  • Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-2d9048c36d26.