Speed up interpreter hot paths - #31
Merged
Merged
Conversation
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
Valueallocations from interpreter result pushes by using the typed runtime-stack writersStore; oversized, sparse, or over-budget bodies fall back to the originalInstrobjectsWhy
The interpreter's hot path paid for two avoidable costs:
Value.I32/I64/F32/F64objects before being unpacked into the runtime stackThe typed stack path removes the first source of allocation. The packed representation removes repeated object decoding while retaining a bounded-memory fallback for cold, sparse, and very large bodies.
Performance
Focused before/after runs used the same benchmark sources and JDK 17.
The JVM first-invoke tradeoff is a one-time 0.237 us and 2.36 KiB per packed body. The iOS paired stripped-binary gate also improved from 690,168 to 673,784 incremental bytes, below the 1,500,000-byte limit.
Validation
./gradlew --no-watch-fs --rerun-tasks :core:jvmTest :core:macosArm64Test:samples-cli:run:benchmarks:performanceGateToolTest :benchmarks:jvmSmokeBenchmarkscripts/verify-ios-core-footprint.shExternal spec and WASI corpora were not configured locally and remain covered by CI.