-
-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(transformer): pre-allocate more stack space #6095
refactor(transformer): pre-allocate more stack space #6095
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @overlookmotel and the rest of your teammates on Graphite |
This stack of PRs introducing But we can also use these more efficient stack structures in many other places in our codebase, so the impact will be more significant in aggregate, especially for stacks which get pretty deep e.g. |
CodSpeed Performance ReportMerging #6095 will not alter performanceComparing Summary
|
Merge activity
|
e1a6472
to
e60ce50
Compare
Pre-allocate 16 bytes for stacks in transforms that use them. Allocators usually support minimum of 16 bytes for allocations anyway. Now that we're using `SparseStack`, allocating decent capacity is now cheap.
f2a5883
to
f191fb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI previous PR crashed somewhere https://github.com/oxc-project/monitor-oxc/actions/runs/11065170732/job/30744171583
Running Transformer.
thread 'main' panicked at /home/runner/work/monitor-oxc/oxc/crates/oxc_transformer/src/helpers/stack/standard.rs:341:9:
assertion failed: self.cursor < self.end
Fix incorrect debug assertion in `Stack`. The code itself was fine, but debug assertion was testing the wrong thing. This error was spotted by @Boshen: #6095 (review) Also add more debug asserts and change test so it fails before the fix in this PR.
Pre-allocate 16 bytes for stacks in transforms that use them. Allocators usually support minimum of 16 bytes for allocations anyway. Now that we're using `SparseStack`, allocating decent capacity is now cheap.
f191fb3
to
8146517
Compare
6a68db0
to
ea6c125
Compare
Pre-allocate 16 bytes for stacks in transforms that use them. Allocators usually support minimum of 16 bytes for allocations anyway. Now that we're using `SparseStack`, allocating decent capacity is now cheap.
8146517
to
e0f3c64
Compare
Pre-allocate 16 bytes for stacks in transforms that use them. Allocators usually support minimum of 16 bytes for allocations anyway. Now that we're using `SparseStack`, allocating decent capacity is now cheap.
ea6c125
to
9ac80bd
Compare
e0f3c64
to
58fd6eb
Compare
## [0.30.4] - 2024-09-28 ### Bug Fixes - 8582ae3 codegen: Missing parentheses if there is a pure comment before a NewExpression as a ComputedMemberExpression's callee (#6105) (Dunqing) - fd6798f parser: Remove unintended `pub Kind` (#6109) (Boshen) - 6f98aad sourcemap: Align sourcemap type with Rollup (#6133) (Boshen) - 64d4756 transformer: Fix debug assertion in `Stack` (#6106) (overlookmotel) ### Performance - 05852a0 codegen: Do not check whether there are annotation comments or not if we don't preserve annotation comments (#6107) (Dunqing) ### Documentation - 26a273a oxc-transform: Update README (Boshen) - e2c5baf transformer: Fix formatting of README (#6111) (overlookmotel) ### Refactor - 2090fce semantic: Fix lint warning in nightly (#6110) (overlookmotel) - 7bc3988 transformer: Remove dead code (#6124) (overlookmotel) - 07fe45b transformer: Exponentiation operator: convert to match (#6123) (overlookmotel) - 4387845 transformer: Share `TypeScriptOptions` with ref not `Rc` (#6121) (overlookmotel) - 09e41c2 transformer: Share `TransformCtx` with ref not `Rc` (#6118) (overlookmotel) - 58fd6eb transformer: Pre-allocate more stack space (#6095) (overlookmotel) - 9ac80bd transformer: Add wrapper around `NonNull` (#6115) (overlookmotel) - c50500e transformer: Move common stack functionality into `StackCommon` trait (#6114) (overlookmotel) - 9839059 transformer: Simplify `StackCapacity` trait (#6113) (overlookmotel) --------- Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Pre-allocate 16 bytes for stacks in transforms that use them. Allocators usually support minimum of 16 bytes for allocations anyway. Now that we're using
SparseStack
, allocating decent capacity is now cheap.