perf(codegen): use isize for quote counters#13441
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes performance in the codegen module for WASM environments by changing quote counter variables from i64 to isize. This is a targeted optimization that reduces memory usage and improves performance on 32-bit WASM where isize is a single word rather than requiring 64-bit arithmetic.
- Changed quote cost counter variables from
i64toisizein two functions - Updated comments to clarify maximum string length constraints on different platforms
- Maintained overflow prevention while optimizing for 32-bit WASM performance
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #13441 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
Small perf optimization for codegen when running in WASM. Use `isize` instead of `i64` for quote cost counters. `isize` is sufficient to prevent overflow, and is a single "word" in 32-bit WASM.
6cf572a to
39fc0d6
Compare

Small perf optimization for codegen when running in WASM. Use
isizeinstead ofi64for quote cost counters.isizeis sufficient to prevent overflow, and is a single "word" in 32-bit WASM.