On Wed, Sep 21, 2016 at 8:28 PM, Jakub Narębski <jna...@gmail.com> wrote: > W dniu 21.09.2016 o 20:04, Ævar Arnfjörð Bjarmason pisze: >> It would make some code like git_print_log() a bit more complex / >> fragile, since it would have to work on multi-line strings, but >> anything that needed to do a regex match / replacement would be much >> faster. > > Would it? Did you perform any synthetic micro-benchmark?
No, just experience. With the caveat that this may not matter at all in this context, C-like code in Perl is slow, if you can offload things to one big regex operation it's usually faster. >> >> But OTOH I think perhaps we're worrying about nothing when it comes to >> the performance. I haven't been able to make gitweb display more than >> a 100 or so commits at a time (haven't found where exactly in the code >> these limits are), any munging we do on the log messages would have to >> be pretty damn slow to matter. > > sub git_log_generic { > > # [...] > > my @commitlist = > parse_commits($commit_hash, 101, (100 * $page), > defined $file_name ? ($file_name, > "--full-history") : ()); > > Here you have it (it probably should be a constant; this number can be > found in a few other places). Thanks!