perf(formatter_core): share one thread-cached scratch vector across staging buffers - #24583
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
Merging this PR will not alter performance
Comparing Footnotes
|
aa1921c to
12a1158
Compare
72ae10f to
c835270
Compare
c835270 to
7aa30a3
Compare
12a1158 to
8039aca
Compare
8039aca to
c880bce
Compare
7aa30a3 to
a9a2c78
Compare
c880bce to
d7cedab
Compare
a9a2c78 to
c3b460b
Compare
Merge activity
|
d7cedab to
c191f51
Compare
c3b460b to
7810e8a
Compare
Revert #24583. After re-measuring, I found no significant improvement. It is not worth the amount of code required. Also, the fundamental issue is that the end-side formatter, rather than Oxfmt itself, is performing cross-file caching, which is an undesirable side effect.
# Oxlint ### 🚀 Features - 8d31dfa linter: Verify eslint/no-restricted-globals config schema (#24598) (vigneshwar) - 7069621 linter: Verify jest/vitest prefer-lowercase-title config schema (#24724) (Bartok) - 016cf2a linter/oxc: Add bad-match-all-arg rule (#24900) (camc314) - cdc941e linter/n: Implement `exports-style` rule (#24087) (Mikhail Baev) - 1ad6f6c linter/eslint: Implement `id-denylist` rule (#24632) (Mikhail Baev) - 678bbb5 linter/typescript-eslint: Implement suggestion for `class-literal-property-style` rule (#24766) (Mikhail Baev) ### 🐛 Bug Fixes - a5f3a0e linter: Mark missing suggestions as pending (#24956) (Mikhail Baev) - a065946 oxlint: Absolutize explicit CLI paths even with --no-ignore (#24646) (Bez Sahara) - 17688bb linter/jsx-a11y/interactive-supports-focus: Match eslint behavior for custom components (#24780) (Cole Ellison) - 0aef19e linter/typescript/no-confusing-non-null-assertion: Report `in` and `instanceof` (#24825) (Mikhail Baev) - 361dce9 linter: Unicorn/no-array-reverse and no-array-sort replacements should be suggestions (#24848) (klem) - 9213560 config: Preserve defineConfig field JSDoc (#24326) (周星星同学) - 334d884 linter/node/no-top-level-await: Clarify diagnostic (#24803) (camc314) - b9fc6af linter/eslint/func-names: Ignore overloads (#24801) (camc314) - e80574f estree: Handle empty spans serializing `ImportMeta` and `NewTarget` (#24775) (overlookmotel) ### ⚡ Performance - c75dc60 linter: Avoid `Vec` allocations via `bound_names` (#24959) (connorshea) - 9f9f39d linter/eslint/no-const-assign: Avoid `Vec` allocation per `const` declarator (#24953) (connorshea) - 10a621e linter/typescript/adjacent-overload-signatures: Avoid collecting vec in some cases (#24874) (connorshea) - ed167e1 linter/node/exports-style: Iterate once over global references (#24877) (connorshea) - 69908fe linter: Avoid allocations in jest/no-deprecated-functions (#24866) (Connor Shea) - a3585d7 linter: Speed up jest/vitest prefer-each (#24872) (Connor Shea) - 62fe640 linter/eslint/prefer-rest-params: Run once per file (#24873) (Connor Shea) - 7a7aa54 linter/eslint/no-this-before-super: Skip files without classes (#24869) (Connor Shea) - 4ad0c94 linter/plugins: Faster copying comments to JS allocator (#24858) (overlookmotel) - 4c25b91 linter/plugins: Test booleans with explicit `=== false` (#24830) (overlookmotel) - b7add00 linter/plugins: Remove check in loop in `getDisableDirectives` (#24833) (overlookmotel) ### 📚 Documentation - 3ff2e0e linter: Clarify config extends types (#24936) (Boshen) # Oxfmt ### 🚀 Features - eabfe01 oxfmt/lsp: Support `oxc.fmt.disableNestedConfig` (#24965) (leaysgur) - 2357a10 formatter_yaml: Implement YAML formatter (#24534) (leaysgur) ### 🐛 Bug Fixes - 761a882 formatter_css: Keep leading `+` in An+B to enable idempotency check (#24973) (leaysgur) - e037709 formatter: Stop preserving indent for embedded template exprs (#24972) (leaysgur) - ae1a39b formatter_css: Align wrapped selector-arg indent (#24971) (leaysgur) - 143fd1f formatter: Align quoted `new` signature (#24883) (leaysgur) - 07ff12f formatter_yaml: Fix indent, blank, and spacing issues (#24837) (leaysgur) - d076b40 formatter: Check calee chain is_simple (#24871) (leaysgur) - fb34196 formatter_css: Keep non-ASCII strings with quotes (#24870) (leaysgur) - 9213560 config: Preserve defineConfig field JSDoc (#24326) (周星星同学) - 31783e9 formatter_css: Print nested SCSS map with consistent indent (#24789) (leaysgur) - 8eb9eca formatter/jsdoc: Respect `singleQuote` option in `@import` (#24787) (leaysgur) - 6f05ac4 formatter: Fix template literal formatting (#24786) (leaysgur) ### ⚡ Performance - bb73b23 formatter_core: Bound the thread-local scratch cache (#24793) (leaysgur) - a5f7b15 formatter: Stage assignment-like left hand side on the heap (#24613) (leaysgur) - 94de05f formatter: Accumulate JSX child-list builders on the heap (#24585) (leaysgur) - 7810e8a formatter_core: Share one thread-cached scratch vector across staging buffers (#24583) (leaysgur) - c191f51 formatter_core: Stage IR buffers on the heap to reduce arena memory (#24582) (leaysgur) ### 📚 Documentation - 69126a0 formatter_css,fomatter_graphql,formatter_yaml: Update AGENTS.md (#24821) (leaysgur)

Apply #24539, share
ScratchBuffer's buffer.NOTE: checked-in vectors keep their high-water capacity for the thread's lifetime (same policy as #24539). This is ~KB for regular sources, and fine.