Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 13, 2025

stmts here is an ArenaVec<&Statement> (&Statement not Statement). This is a temporary collection, and doesn't end up in the AST, so we shouldn't store it in the arena.

Use a std::vec::Vec instead of oxc_allocator::Vec.

This should also remove some of the lifetime problems we have in #9656.

This change may cause a small perf hit, but in my view it's still a good change. If we want to get a speed boost, a better solution would be to have a temporary "scratch space" arena which we can allocate all temporary values into. This would likely give us a sizeable speed boost across many parts of Oxc (oxc-project/backlog#121).

Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-isolated-declarations Isolated Declarations C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Mar 13, 2025
@overlookmotel overlookmotel marked this pull request as ready for review March 13, 2025 02:52
@overlookmotel overlookmotel requested a review from Dunqing as a code owner March 13, 2025 02:52
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 13, 2025

CodSpeed Performance Report

Merging #9733 will not alter performance

Comparing 03-12-refactor_isolated_declarations_do_not_store_temp_values_in_arena (a61a50b) with main (3943563)

Summary

✅ 33 untouched benchmarks

Copy link
Member

@Dunqing Dunqing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me!

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Mar 13, 2025
Copy link
Member

Dunqing commented Mar 13, 2025

Merge activity

  • Mar 12, 11:09 PM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 12, 11:09 PM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 12, 11:18 PM EDT: A user merged this pull request with the Graphite merge queue.

…9733)

`stmts` here is an `ArenaVec<&Statement>` (`&Statement` not `Statement`). This is a temporary collection, and doesn't end up in the AST, so we shouldn't store it in the arena.

Use a `std::vec::Vec` instead of `oxc_allocator::Vec`.

This should also remove some of the lifetime problems we have in #9656.

This change may cause a small perf hit, but in my view it's still a good change. If we want to get a speed boost, a better solution would be to have a temporary "scratch space" arena which we can allocate *all* temporary values into. This would likely give us a sizeable speed boost across many parts of Oxc (oxc-project/backlog#121).
@graphite-app graphite-app bot force-pushed the 03-12-refactor_isolated_declarations_do_not_store_temp_values_in_arena branch from 592ed29 to a61a50b Compare March 13, 2025 03:10
@overlookmotel overlookmotel removed the 0-merge Merge with Graphite Merge Queue label Mar 13, 2025
@overlookmotel
Copy link
Member Author

I've taken off the merge label in hope of stopping Graphite - but maybe it's unstoppable! Would like to see the benchmarks first ideally.

@graphite-app graphite-app bot merged commit a61a50b into main Mar 13, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 03-12-refactor_isolated_declarations_do_not_store_temp_values_in_arena branch March 13, 2025 03:18
@Dunqing
Copy link
Member

Dunqing commented Mar 13, 2025

I've taken off the merge label in hope of stopping Graphite - but maybe it's unstoppable! Would like to see the benchmarks first ideally.

Only 0.2ms dropped

image

@overlookmotel
Copy link
Member Author

-0.3% perf hit. That's no so bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-isolated-declarations Isolated Declarations C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants