refactor(oxfmt): simplify wrap_format_embeded#15798
Merged
graphite-app[bot] merged 1 commit intomainfrom Nov 18, 2025
Merged
Conversation
Member
Author
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. |
3757667 to
a67086a
Compare
This was referenced Nov 18, 2025
f0e48a1 to
28f5485
Compare
a67086a to
4f0cd3f
Compare
4f0cd3f to
d30c779
Compare
d30c779 to
48d52c1
Compare
Member
|
Just FYI, you may or may not know:
So while the benchmark might not be very reliable, I still think this approach is better. 😅 |
Member
Merge activity
|
`call_async` does the same thing as `call_with_return_value` + `channel`, so use `call_async` to simplify it and reduce some unnecessary overhead
### Benchmark
I benchmarked this PR locally, and the results indicate that it is 9% faster than before in the `Outline` repo.
EDIT: Maybe just a noise since `Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interference from other programs.` was displayed.
```shell
Setup complete! Run 'pnpm run bench' to start benchmarking.
=========================================
JavaScript/TypeScript Formatter Benchmark
=========================================
Formatters: Prettier, Biome, Oxfmt
Starting benchmark with:
- 3 warmup runs
- 10 benchmark runs
- Git reset before each run
=========================================
Benchmarking parser.ts (single large file)
=========================================
Benchmark 1: biome
Time (mean ± σ): 69.5 ms ± 0.9 ms [User: 55.4 ms, System: 9.7 ms]
Range (min … max): 68.3 ms … 71.2 ms 10 runs
Benchmark 2: oxfmt-new
Time (mean ± σ): 30.7 ms ± 0.3 ms [User: 23.7 ms, System: 11.0 ms]
Range (min … max): 30.3 ms … 31.3 ms 10 runs
Benchmark 3: oxfmt-old
Time (mean ± σ): 30.4 ms ± 0.3 ms [User: 23.6 ms, System: 10.6 ms]
Range (min … max): 30.1 ms … 30.9 ms 10 runs
Summary
oxfmt-old ran
1.01 ± 0.01 times faster than oxfmt-new
2.29 ± 0.04 times faster than biome
=========================================
Benchmarking Outline repository
=========================================
Benchmark 1: biome
Time (mean ± σ): 154.6 ms ± 6.0 ms [User: 825.2 ms, System: 555.8 ms]
Range (min … max): 147.5 ms … 164.0 ms 10 runs
Benchmark 2: oxfmt-new
Time (mean ± σ): 65.8 ms ± 2.3 ms [User: 196.0 ms, System: 265.3 ms]
Range (min … max): 60.7 ms … 68.8 ms 10 runs
Benchmark 3: oxfmt-old
Time (mean ± σ): 72.0 ms ± 17.7 ms [User: 195.0 ms, System: 277.3 ms]
Range (min … max): 62.6 ms … 121.1 ms 10 runs
Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs.
Summary
oxfmt-new ran
1.09 ± 0.27 times faster than oxfmt-old
2.35 ± 0.12 times faster than biome
```
48d52c1 to
56a99d5
Compare
taearls
pushed a commit
to taearls/oxc
that referenced
this pull request
Dec 11, 2025
`call_async` does the same thing as `call_with_return_value` + `channel`, so use `call_async` to simplify it and reduce some unnecessary overhead
### Benchmark
I benchmarked this PR locally, and the results indicate that it is 9% faster than before in the `Outline` repo.
EDIT: Maybe just a noise since `Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interference from other programs.` was displayed.
```shell
Setup complete! Run 'pnpm run bench' to start benchmarking.
=========================================
JavaScript/TypeScript Formatter Benchmark
=========================================
Formatters: Prettier, Biome, Oxfmt
Starting benchmark with:
- 3 warmup runs
- 10 benchmark runs
- Git reset before each run
=========================================
Benchmarking parser.ts (single large file)
=========================================
Benchmark 1: biome
Time (mean ± σ): 69.5 ms ± 0.9 ms [User: 55.4 ms, System: 9.7 ms]
Range (min … max): 68.3 ms … 71.2 ms 10 runs
Benchmark 2: oxfmt-new
Time (mean ± σ): 30.7 ms ± 0.3 ms [User: 23.7 ms, System: 11.0 ms]
Range (min … max): 30.3 ms … 31.3 ms 10 runs
Benchmark 3: oxfmt-old
Time (mean ± σ): 30.4 ms ± 0.3 ms [User: 23.6 ms, System: 10.6 ms]
Range (min … max): 30.1 ms … 30.9 ms 10 runs
Summary
oxfmt-old ran
1.01 ± 0.01 times faster than oxfmt-new
2.29 ± 0.04 times faster than biome
=========================================
Benchmarking Outline repository
=========================================
Benchmark 1: biome
Time (mean ± σ): 154.6 ms ± 6.0 ms [User: 825.2 ms, System: 555.8 ms]
Range (min … max): 147.5 ms … 164.0 ms 10 runs
Benchmark 2: oxfmt-new
Time (mean ± σ): 65.8 ms ± 2.3 ms [User: 196.0 ms, System: 265.3 ms]
Range (min … max): 60.7 ms … 68.8 ms 10 runs
Benchmark 3: oxfmt-old
Time (mean ± σ): 72.0 ms ± 17.7 ms [User: 195.0 ms, System: 277.3 ms]
Range (min … max): 62.6 ms … 121.1 ms 10 runs
Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs.
Summary
oxfmt-new ran
1.09 ± 0.27 times faster than oxfmt-old
2.35 ± 0.12 times faster than biome
```
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.

call_asyncdoes the same thing ascall_with_return_value+channel, so usecall_asyncto simplify it and reduce some unnecessary overheadBenchmark
I benchmarked this PR locally, and the results indicate that it is 9% faster than before in the
Outlinerepo.EDIT: Maybe just a noise since
Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interference from other programs.was displayed.