feat: add inner loop and compile-once-run-many optimization for Java benchmarking#1245
Merged
Conversation
…benchmarking - Add inner loop in Java test instrumentation for JIT warmup within single JVM - Implement compile-once-run-many: compile tests once with Maven, then run directly via JUnit Console Launcher (~500ms vs ~5-10s per invocation) - Add fallback to Maven-based execution when direct execution fails - Update parsing to handle JUnit Console Launcher output format - Add inner_iterations parameter (default: 100) to control loop count - Add comprehensive E2E tests for inner loop benchmarking Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Configure JUnit Console Launcher to capture stdout/stderr in XML reports: - Add --config=junit.platform.output.capture.stdout=true - Add --config=junit.platform.output.capture.stderr=true - Change --details=verbose to --details=none to avoid duplicate output This ensures timing markers are properly captured in the JUnit XML's <system-out> element, eliminating the need to rely on subprocess stdout fallback for parsing timing markers. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Inner Loop Instrumentation
_add_timing_instrumentation()to wrap test code in a for loopCODEFLASH_INNER_ITERATIONSfrom environment (default: 100)Compile-Once-Run-Many Optimization
_compile_tests()- compiles tests once withmvn test-compile_get_test_classpath()- gets classpath from Maven_run_tests_direct()- runs tests directly via JUnit Console LauncherParsing Updates
system-outhas no timing markersBenchmark Flow
Test plan
🤖 Generated with Claude Code