Skip to content

Comments

refactor(allocator)!: put AllocatorPool behind pool feature#13373

Merged
graphite-app[bot] merged 1 commit intomainfrom
08-29-refactor_allocator_put_allocatorpool_behind_pool_feature
Aug 29, 2025
Merged

refactor(allocator)!: put AllocatorPool behind pool feature#13373
graphite-app[bot] merged 1 commit intomainfrom
08-29-refactor_allocator_put_allocatorpool_behind_pool_feature

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Aug 28, 2025

AllocatorPool is only used in linter. Parser, transformer, minifier etc don't need it. So put it behind a pool cargo feature.

This complicates the many #[cfg] attrs even further, but this is preparation for merging the 2 AllocatorPool implementations, and removing the fixed_size feature, which will remove a lot of this #[cfg] mess.

@github-actions github-actions bot added A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Aug 28, 2025
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.

@overlookmotel overlookmotel marked this pull request as ready for review August 28, 2025 23:53
Copilot AI review requested due to automatic review settings August 28, 2025 23:53
@overlookmotel overlookmotel requested a review from camc314 as a code owner August 28, 2025 23:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the AllocatorPool to be conditionally compiled behind a pool feature, optimizing dependencies for components that don't need pooled allocation functionality. The change reduces bloat for parser, transformer, minifier and other components while allowing the linter to explicitly opt into pool functionality.

  • Adds a new pool cargo feature to oxc_allocator
  • Updates conditional compilation attributes to gate AllocatorPool behind the pool feature
  • Enables the pool feature in oxc_linter which requires AllocatorPool

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
crates/oxc_linter/Cargo.toml Explicitly enables the pool feature for the allocator dependency
crates/oxc_allocator/src/lib.rs Updates #[cfg] attributes to conditionally compile pool-related code behind the pool feature
crates/oxc_allocator/README.md Documents the new pool feature
crates/oxc_allocator/Cargo.toml Defines the new pool feature and makes fixed_size depend on it

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 28, 2025

CodSpeed Instrumentation Performance Report

Merging #13373 will not alter performance

Comparing 08-29-refactor_allocator_put_allocatorpool_behind_pool_feature (df8e639) with main (13470b2)1

Summary

✅ 38 untouched benchmarks

Footnotes

  1. No successful run was found on main (df8e639) during the generation of this report, so 13470b2 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Aug 29, 2025
Copy link
Member Author

overlookmotel commented Aug 29, 2025

Merge activity

`AllocatorPool` is only used in linter. Parser, transformer, minifier etc don't need it. So put it behind a `pool` cargo feature.

This complicates the many `#[cfg]` attrs even further, but this is preparation for merging the 2 `AllocatorPool` implementations, and removing the `fixed_size` feature, which will remove a lot of this `#[cfg]` mess.
@graphite-app graphite-app bot force-pushed the 08-29-refactor_allocator_put_allocatorpool_behind_pool_feature branch from 217ff10 to df8e639 Compare August 29, 2025 16:51
@graphite-app graphite-app bot merged commit df8e639 into main Aug 29, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 08-29-refactor_allocator_put_allocatorpool_behind_pool_feature branch August 29, 2025 16:56
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 29, 2025
This was referenced Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter 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.

2 participants