Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Clean but not very effective optimization (lex.c / dupstring_wlen)
- X-seq: zsh-workers 43696
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Clean but not very effective optimization (lex.c / dupstring_wlen)
- Date: Wed, 17 Oct 2018 00:24:24 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=XCIRoNRu3wEd57emIfRjvMYRIIF5p80pOUCcP1odfz4=; b=f2J6m6d9eWbEjBfjROOhruw9u+XfYvBSvNRkfR0D2ixDQK/v0vAUThwl70PNyAxGuV MrYt+tRX6PsTAVZ36MUQMlyi871dOHS57R+gtwyn9kLgxRxbRTz1f5YqyBcaushtQxJH +qztJf83TEXOi42rX7+evv+p0fZCzgpwhL+9zjEyCJIDbx5Xw+eJAqlYE5HwZce0xa/L DNu/6SrjyfRnaOqEAT4tkNq2NPjBo2Z2hWkYDvrTRWMdWxghaMC4Y/4crH1Ion2wcNHO 4tSSZ2wTJOdWR0wfAZ1I9X50pUsd2tVdh5R/3IIFvZmqdTVaLIkM3N3ULJj0PeA0vd9e ffgw==
- In-reply-to: <CAKc7PVCmFWuAzDbO-_r_FJKZ3AwoCCvuiCO212gGyJ-S2U=uUQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCmFWuAzDbO-_r_FJKZ3AwoCCvuiCO212gGyJ-S2U=uUQ@mail.gmail.com>
PS. I've run the F-Sy-H test via callgrind, twice, and in both runs
there is a drop in total instruction count, of 12.3 mln or 13 mln, out
of the total instruction count being 7.3 bilion. The lesser count is
of course for the optimized Zsh.
On Wed, 17 Oct 2018 at 00:08, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Hello,
> dupstring_wlen (i.e. with-len) is ready to use, so this patch is just
> 4 changes dupstring(s) -> dupstring_wlen(s, l). Each of those
> dupstrings has a nice strlen() invocation already there in lex.c, a
> few lines above.
>
> Callgrind doesn't report any real change in number of instructions of
> strlen() call and a test that repeatedly invokes (z) flag on a 32-line
> buffer 150 times reports 24 ms for both unoptimized and optimized
> version.
>
> However performance test of F-Sy-Highlighting reports rather stable 40
> ms gain – out of ~3000 ms, so not much.
>
> In general simplicity of this patch made me send it.
>
> --
> Sebastian Gniazdowski
> News: https://twitter.com/ZdharmaI
> IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
> Blog: http://zdharma.org
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author