Skip to content

perf(numfmt): use reusable buffer for line processing#10794

Closed
CrazyRoka wants to merge 1 commit intouutils:mainfrom
CrazyRoka:optimize-numfmt-handle-buffer
Closed

perf(numfmt): use reusable buffer for line processing#10794
CrazyRoka wants to merge 1 commit intouutils:mainfrom
CrazyRoka:optimize-numfmt-handle-buffer

Conversation

@CrazyRoka
Copy link
Contributor

Previously, numfmt used input.split(), which allocates a new Vec<u8> for every line in the input. For large datasets, this puts unnecessary strain on the allocator.

This PR switches to read_until using a single Vec that is cleared and reused. This transition provides a noticeable performance boost in high-throughput scenarios or when processing files with millions of lines.

@CrazyRoka
Copy link
Contributor Author

I see no implements in codspeed

@CrazyRoka CrazyRoka closed this Feb 7, 2026
@CrazyRoka CrazyRoka deleted the optimize-numfmt-handle-buffer branch February 7, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant