feat: support void method optimization in Java pipeline#1980
feat: support void method optimization in Java pipeline#1980HeshamHM28 wants to merge 5 commits intomainfrom
Conversation
Discover void methods, instrument them by serializing the receiver instead of a return value, and treat all-null comparisons as equivalent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @HeshamHM28's task in 10m 46s —— View job PR Review SummaryTasks
Prek Checks
Code ReviewBug: Non-precise timing void path generates undeclared variable reference
elif is_void:
replacement = f"{bare_call_stmt} {serialize_stmt}"In this path ( f"_cf_serializedResult{iter_id} = com.codeflash.Serializer.serialize({serialize_target});"But Currently unreachable in production ( Bug: Static-imported void methods serialized as instance calls
is_static_call = receiver != "this" and receiver[:1].isupper()When a void method is called via static import without an explicit receiver — e.g., This affects static imports ( Minor:
|
⚡️ Codeflash found optimizations for this PR📄 25% (0.25x) speedup for
|
…2026-04-03T13.47.39 ⚡️ Speed up method `JavaAssertTransformer._generate_replacement` by 25% in PR #1980 (`cf-java-void-optimization`)
|
This PR is now faster! 🚀 @claude[bot] accepted my optimizations from: |
…id method state tests
10cfedf to
3bc4941
Compare
Review Finding: Missing
|
Instrumentation writes verification_type="void_state" for void methods, but the enum lacked this value, causing ValueError on every SQLite row parse. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
InPlaceSorter.bubbleSortInPlace(arr)), serialize the arguments instead of the class name, which is not a value and can't be cast to Objectsorter.bubbleSortInPlace(arr)), serialize the receiver object to capture side effects