Commit 4843475
committed
perf(formatter): do not write elements to the flat buffer if the layout is multline (#16630)
https://github.com/oxc-project/oxc/blob/c17b3d4b471d5404f67b6bb6a55921d173014318/crates/oxc_formatter/src/write/jsx/child_list.rs#L49-L50
If `force_multiline` is true, that means the flat buffer will never be used, so we should pass a flag to disable the flat buffer at the start, rather than disabling it after the first child was written in the flat buffer
Disabling here is too late; a child has already been written in the flat buffer, which causes a little bit of a performance hit.
https://github.com/oxc-project/oxc/blob/b3581c85f710f79de1a1dfe9af731a7b2edf1b88/crates/oxc_formatter/src/write/jsx/child_list.rs#L328-L3311 parent 10b4f9f commit 4843475
1 file changed
+9
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 49 | | |
| 50 | + | |
| 51 | + | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
310 | 309 | | |
311 | 310 | | |
312 | 311 | | |
313 | | - | |
314 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
315 | 317 | | |
316 | 318 | | |
317 | 319 | | |
| |||
669 | 671 | | |
670 | 672 | | |
671 | 673 | | |
672 | | - | |
673 | | - | |
| 674 | + | |
| 675 | + | |
674 | 676 | | |
675 | 677 | | |
676 | 678 | | |
| |||
0 commit comments