perf(linter/plugins): reuse descriptor objects for Object.defineProperty calls#20505
Merged
graphite-app[bot] merged 1 commit intomainfrom Mar 21, 2026
Conversation
This was referenced Mar 18, 2026
This was referenced Mar 18, 2026
Member
Author
This was referenced Mar 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Optimizes hot-path property definition in the JS linter plugins by reusing PropertyDescriptor objects instead of allocating new descriptor objects for repeated Object.defineProperty calls.
Changes:
- Reuse a module-level
LOC_DESCRIPTORwhen cachingnode.locingetNodeLoc. - Reuse a module-level
OPTIONS_DESCRIPTORwhen updatingcontext.optionsper rule/file.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/oxlint/src-js/plugins/location.ts | Reuses a single PropertyDescriptor for defining cached loc values on AST nodes. |
| apps/oxlint/src-js/plugins/lint.ts | Reuses a single PropertyDescriptor for updating options on rule context objects. |
This was referenced Mar 18, 2026
33b0950 to
982be40
Compare
e627943 to
48e7129
Compare
982be40 to
c774a9d
Compare
48e7129 to
24da144
Compare
24da144 to
5984a66
Compare
c774a9d to
44e3182
Compare
44e3182 to
cf6e31d
Compare
Contributor
Merge activity
|
…erty` calls (#20505) Small optimization. Don't create temporary objects repeatedly just to pass props to `Object.defineProperty`. Re-use a single object and reuse it instead.
cf6e31d to
a187333
Compare
This was referenced Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Small optimization. Don't create temporary objects repeatedly just to pass props to
Object.defineProperty. Re-use a single object and reuse it instead.