D1973: bdiff: write a native version of splitnewlines

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Fri Feb 2 11:26:07 EST 2018

durin42 added inline comments.


> indygreg wrote in bdiff.c:216-217
> I have a feeling this extra line scan will matter in a benchmark. Could you `perf record` the new `hg perf*` command and verify? If it is a big deal, I would allocate an `int[16384]` array on the stack or something to deal with the common case and store additional newline offsets on the heap so we only do the newline scan once.

It's already enough of a win I'd like to land the simple version and then focus on spending effort on a Rust version rather than continuing with this. How do you feel about that as a plan?

  rHG Mercurial


To: durin42, #hg-reviewers, indygreg
Cc: indygreg, yuja, mercurial-devel

More information about the Mercurial-devel mailing list