Skip to content
Snippets Groups Projects
Commit 65839176cea9 authored by Arseniy Alekseyev's avatar Arseniy Alekseyev
Browse files

rhg: buffer the output of `rhg status`

Before this commit, `hg status` was issuing multiple `write` syscalls per
line printed, separately writing out the path and the status fragments.

This change makes hg status on large number of files significantly faster,
going from 1.8s to 1.2s in one case.

This requires adding the color information to `StdoutBuffer`,
and moving the formatting functions from ui to it.

I made `StdoutBuffer` generic over the underlying writer,
without insisting on BufWriter, because I anticipated the need to use
it with both full-buffered and line-buffered writers.
That didn't end up being necessary, but I think the code is still better
this way.
parent 0f2268783c11
No related branches found
No related tags found
Loading
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment