Skip to content

Expand JMH coverage for JRT and AVM hot paths#483

Merged
bertysentry merged 2 commits into
mainfrom
482-add-jrt-and-avm-hot-path-microbenchmarks
May 18, 2026
Merged

Expand JMH coverage for JRT and AVM hot paths#483
bertysentry merged 2 commits into
mainfrom
482-add-jrt-and-avm-hot-path-microbenchmarks

Conversation

@bertysentry
Copy link
Copy Markdown
Contributor

Summary

  • Added focused JMH coverage for JRT conversion and truthiness helpers, including numeric strings, boxed numbers, empty/non-numeric values, and regex-backed boolean evaluation.
  • Added AVM expression benchmarks that compile expressions once, bind input during setup, and measure only AVM.eval(...) on stable records.
  • Added short script-level benchmarks for mixed numeric input and adjusted the benchmark workflows so the default JMH pattern publishes all benchmarks.
  • Reduced the existing compare benchmark to 2 warmup iterations and 3 measurement iterations.

Testing

  • mvn formatter:format
  • mvn -Pbenchmark -DskipTests package
  • java -jar target\jawk-6.4.01-SNAPSHOT-benchmarks.jar -l .
  • Focused JMH smoke run for AVMExpressionBenchmark.literalAddition
  • mvn test

@bertysentry bertysentry linked an issue May 15, 2026 that may be closed by this pull request
@bertysentry bertysentry requested a review from Copilot May 15, 2026 11:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the JMH benchmark suite to cover additional hot paths in Jawk’s runtime (JRT) and expression evaluation (AVM), improving performance regression visibility for common conversion/truthiness and eval scenarios.

Changes:

  • Added new JMH benchmarks for JRT conversion, truthiness, and increment helpers (JRTHotPathBenchmark).
  • Added AVM expression-evaluation benchmarks that compile expressions once and measure AVM.eval(...) (AVMExpressionBenchmark), plus short end-to-end script benchmarks (AwkScriptBenchmark).
  • Updated benchmark iteration counts and adjusted workflow defaults for the “run all benchmarks” pattern.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/jmh/java/io/jawk/jrt/JRTHotPathBenchmark.java Adds microbenchmarks for common JRT conversions, truthiness, and inc(...) operand shapes.
src/jmh/java/io/jawk/jrt/JRTCompare2Benchmark.java Reduces warmup/measurement iterations to shorten benchmark runtime.
src/jmh/java/io/jawk/backend/AVMExpressionBenchmark.java Adds compiled-expression benchmarks for AVM.prepareForEval(...) + AVM.eval(...) hot path.
src/jmh/java/io/jawk/AwkScriptBenchmark.java Adds small script-level benchmarks to exercise a broader runtime path (parse → run → output).
.github/workflows/release.yml Changes the default JMH include pattern used during release benchmark publishing.
.github/workflows/benchmarks.yml Changes the default JMH include pattern used in the publish-benchmarks workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/jmh/java/io/jawk/jrt/JRTHotPathBenchmark.java Outdated
Comment thread src/jmh/java/io/jawk/backend/AVMExpressionBenchmark.java Outdated
Comment thread src/jmh/java/io/jawk/AwkScriptBenchmark.java Outdated
Comment thread .github/workflows/benchmarks.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Comment thread src/jmh/java/io/jawk/jrt/JRTHotPathBenchmark.java Outdated
Comment thread src/jmh/java/io/jawk/backend/AVMExpressionBenchmark.java Outdated
Comment thread src/jmh/java/io/jawk/AwkScriptBenchmark.java Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/benchmarks.yml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@bertysentry bertysentry merged commit 432e75d into main May 18, 2026
9 checks passed
@bertysentry bertysentry deleted the 482-add-jrt-and-avm-hot-path-microbenchmarks branch May 18, 2026 10:24
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.

Add JRT and AVM hot-path microbenchmarks

2 participants