[codex] Inline Uint8Array access for const local lengths#5341
Merged
proggeramlug merged 2 commits intoJun 18, 2026
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Base automatically changed from
codex/perry-performance-cycle-20260617-17
to
codex/perry-performance-cycle-20260617-16
June 18, 2026 11:13
7433964
into
codex/perry-performance-cycle-20260617-16
3 checks passed
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
const buf = new Uint8Array(SIZE)whenSIZEis an immutable finite integer length to register a native-owned Uint8Array view.buf[i]lowers to inline byte load/store instead ofjs_uint8array_get/set, with collector and IR regression coverage.Verification
cargo fmt --checkgit diff --checkcargo test -p perry-codegen collectors::hir_facts -- --nocapture(9 passed)cargo test -p perry-codegen --test native_proof_buffer_views -- --nocapture(22 passed)cargo test -p perry-codegen --test native_proof_regressions -- --nocapture(45 passed)cargo build --release -p perrytarget/release/perry compile benchmarks/suite/bench_buffer_readwrite.ts -o /tmp/perry-cycle18-final-bench_buffer_readwrite --trace llvm/tmp/perry_llvm_272534_1781722418994040407_0.ll: hot path containsstore i8andload i8; no matchedcall i32 @js_uint8array_getorcall void @js_uint8array_set.Benchmark
bench_buffer_readwrite, checksum12749385600for all runs:/tmp/perry-cycle18-baseline-bench_buffer_readwrite: 836, 824, 817, 864, 832 ms; avg 834.6 ms./tmp/perry-cycle18-final-bench_buffer_readwrite: 94, 86, 76, 99, 76 ms; avg 86.2 ms.