Repository navigation
Use a concrete buffer for ordinary writes - #29819
Conversation
|
Merging this PR will improve performance by 4.77%
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
MichaReiser
left a comment
There was a problem hiding this comment.
Nice. I suggest using Vec(&mut VecBuffer) over destructuring its fields. It keeps the intended isolation and avoids repeating logic.
| } | ||
|
|
||
| impl<'src> DocstringLinePrinter<'_, '_, '_, 'src> { | ||
| impl<'src> DocstringLinePrinter<'_, '_, '_, '_, 'src> { |
Summary
Formattercurrently writes every element through&mut dyn Buffer, even when the destination is a vector. We now construct a formatter with direct references to the vector and formatting state when entering throughVecBuffer::write_fmt:This experiments with the dispatch part of Oxc #27559.