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
Checking pipeline status
Loading
Please register or sign in to comment