Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 23, 2025

Create one Context object for each rule, and reuse it for each file, rather than creating a new Context object per rule, per file.

Have not measured perf, but it seems to make sense to create less objects when possible, and it doesn't really hurt ergonomics.

@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Jul 23, 2025
Copy link
Member Author

overlookmotel commented Jul 23, 2025


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 July 23, 2025 14:09
@graphite-app graphite-app bot changed the base branch from 07-23-perf_napi_oxlint_recycle_more_objects to graphite-base/12475 July 23, 2025 14:17
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jul 23, 2025
Copy link
Contributor

camc314 commented Jul 23, 2025

Merge activity

@graphite-app graphite-app bot changed the base branch from graphite-base/12475 to main July 23, 2025 14:27
Create one `Context` object for each rule, and reuse it for each file, rather than creating a new `Context` object per rule, per file.

Have not measured perf, but it seems to make sense to create less objects when possible, and it doesn't really hurt ergonomics.
@graphite-app graphite-app bot force-pushed the 07-23-perf_napi_oxlint_single_context_object_per_rule branch from d9c7a60 to 94933e8 Compare July 23, 2025 14:28
graphite-app bot pushed a commit that referenced this pull request Jul 23, 2025
Pure refactor - does not alter any code, just re-arranges it.

#12475 moved creation of `Context`s to when rules are loaded. So move `Context` class definition up to be closer to the code which uses it.
@graphite-app graphite-app bot merged commit 94933e8 into main Jul 23, 2025
15 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 23, 2025
@graphite-app graphite-app bot deleted the 07-23-perf_napi_oxlint_single_context_object_per_rule branch July 23, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants