Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Optimization for mb_metastrlenend()



On Thu, 03 Nov 2016 12:44:12 -0700
Sebastian Gniazdowski <psprint@xxxxxxxxxxxx> wrote:
> mb_metastrlenend can quickly count character if it's ASCII (0..127) and
> occurs after complete char. A good test for this has been found – syntax
> highlighting parser working on 823 lines of Zsh-code input. It comes
> from my project HSMW, is a modified and optimized
> zsh-syntax-highlighting parser. Running time before optimizations: 2237
> ms, after: 2027 ms, so this is a 10% optimization for long buffers.
> Repeated the test many times, it's a clear win. For short buffers
> (line-by-line calling the parser on different, hard input) the gain is
> ~30 ms for run times ~1450 ms, so no win. Zprof results for long buffers
> and instruction to repeat the test are attached. Checked that all Zsh
> tests are passing.

Thanks, we do rely throughout on US-ASCII as a 7-bit subset so this is a
reasonable thing to do.

I had to apply it by hand and I've slightly reformatted it, but the code
is identical.

pws



Messages sorted by: Reverse Date, Date, Thread, Author