go-git icon indicating copy to clipboard operation
go-git copied to clipboard

plumbing/object: avoid O(N^2) string building when decoding commit me…

Open dsymonds opened this issue 4 years ago • 1 comments

…ssage

Most commits have relatively small messages, so this was never noticeable. However, there are some repositories that have semi-automated messages that can get very large (e.g. github.com/riscv/riscv-clang and its riscv-trunk branch), on the order of 109k lines. Changing from string += to using a bytes.Buffer reduces the time for Commit.Decode for that specific case from 35s to 74ms.

Signed-off-by: David Symonds [email protected]

dsymonds avatar Nov 20 '19 22:11 dsymonds

Hey, any chance this'll get merged soon, @mcuadros @smola ?

dsymonds avatar Dec 01 '19 22:12 dsymonds