On sam, sep 08, 2007 at 11:59:31 +0000, David Kastrup wrote: > Pierre Habouzit writes: > > > Also remove the "len" parameter, as: > > (1) it was used as a max boundary, and every caller used ~0u > > (2) we check for final NUL no matter what, so it doesn't help for speed. > > That sounds like a change that makes improvement of callers impossible > when it is found out that it leads to a performance issue. Is it only > the pretty-print that is affected? Speaking of performance, here is a small interesting bench: $ for i in `seq 1 10`; do time git-log >| /dev/null; done git-log >| /dev/null 2,12s user 0,08s system 99% cpu 2,205 total git-log >| /dev/null 2,14s user 0,06s system 99% cpu 2,208 total git-log >| /dev/null 2,12s user 0,08s system 99% cpu 2,205 total git-log >| /dev/null 2,10s user 0,10s system 99% cpu 2,209 total git-log >| /dev/null 2,14s user 0,07s system 99% cpu 2,211 total git-log >| /dev/null 2,11s user 0,09s system 99% cpu 2,210 total git-log >| /dev/null 2,15s user 0,05s system 99% cpu 2,213 total git-log >| /dev/null 2,12s user 0,07s system 99% cpu 2,203 total git-log >| /dev/null 2,13s user 0,06s system 99% cpu 2,204 total git-log >| /dev/null 2,17s user 0,09s system 100% cpu 2,254 total $ for i in `seq 1 10`; do time ~/dev/scm/git/git-log >| /dev/null; done ~/dev/scm/git/git-log >| /dev/null 2,06s user 0,11s system 99% cpu 2,185 total ~/dev/scm/git/git-log >| /dev/null 2,11s user 0,07s system 99% cpu 2,192 total ~/dev/scm/git/git-log >| /dev/null 2,10s user 0,10s system 99% cpu 2,207 total ~/dev/scm/git/git-log >| /dev/null 2,10s user 0,08s system 99% cpu 2,188 total ~/dev/scm/git/git-log >| /dev/null 2,10s user 0,08s system 99% cpu 2,187 total ~/dev/scm/git/git-log >| /dev/null 2,10s user 0,10s system 100% cpu 2,196 total ~/dev/scm/git/git-log >| /dev/null 2,08s user 0,11s system 99% cpu 2,195 total ~/dev/scm/git/git-log >| /dev/null 2,11s user 0,08s system 99% cpu 2,193 total ~/dev/scm/git/git-log >| /dev/null 2,10s user 0,08s system 100% cpu 2,188 total ~/dev/scm/git/git-log >| /dev/null 2,12s user 0,07s system 98% cpu 2,213 total $ git rev-list --all | wc -l 64271 The underling repository is a not so old linux-2.6 git repository. git-log is the default unstable git-log, (a pristine 1.5.3.1, pre-new-strbuf). ~/dev/scm/git/git-log is obviously the new one with the whole strbuf patch series applied. Strbufs definitely made the code more readable (at least it's my impression), here is the proof that it did not affected an inch from performance (we even seem to have a marginal 0.5% gain in performance ;p). -- ·O· Pierre Habouzit ··O madcoder@debian.org OOO http://www.madism.org