Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why sourcing a file is not faster than doing a loop with eval, zle -N
- X-seq: zsh-workers 41324
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Why sourcing a file is not faster than doing a loop with eval, zle -N
- Date: Mon, 19 Jun 2017 13:38:12 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=zBPurzaUpF6gVGeZ5GkZERV5UMhS5x2UjdKkjiAhxoI=; b=ArvfKHbcxrI+os4yW+nu+hXuw+4MFSFWTCuNn7Dp8KilIo1FtyZOobkaM4JSq2vVxB Ma8lLbB96b/N/2y3vDan0DWckoX/cA7ZboVgxUPqMsBFv2ChaqWM/dsSgg9VV+vrr2Z6 aJpwo2pFNIT51j+laRZU+s94w75vMZroMKRqVUalXuaqYTK2kb1URKgMag1Mq6BzXI/B 6+5PF8qwI782wTzp/3MhpkxkFJDzMoeSMZet0KwCea07asOQ6e77D0ZBh+GI5n5vKZy6 jUG4h5XQVnMDRU6eLsYAw+be+GLZgWAcbsluL2bCHmiLSjOY/cCwSsUhF6NVw7yOYK7R wZ0Q==
- In-reply-to: <20170619202835.7f207185@ntlworld.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>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <etPan.594513a8.516100cd.10b2e__10513.1716504276$1497699329$gmane$org@zdharma.org> <20170619122413.GA9294@chaz.gmail.com> <170619083116.ZM17323__41722.0601499595$1497886320$gmane$org@torch.brasslantern.com> <20170619161601.GB9294@chaz.gmail.com> <20170619202835.7f207185@ntlworld.com>
Parsing 10,000 lines, each a colon-command followed by misc. text, and
repeated 10 times.
HEAD from git:
Src/zsh -fs 0.31s user 1.24s system 94% cpu 1.634 total
Src/zsh -fs 0.45s user 1.31s system 98% cpu 1.795 total
Src/zsh -fs 0.39s user 1.41s system 95% cpu 1.877 total
Src/zsh -fs 0.31s user 1.16s system 88% cpu 1.652 total
Src/zsh -fs 0.43s user 1.33s system 94% cpu 1.854 total
Src/zsh -fs 0.43s user 1.22s system 92% cpu 1.784 total
Src/zsh -fs 0.37s user 1.32s system 91% cpu 1.848 total
Src/zsh -fs 0.31s user 1.48s system 91% cpu 1.948 total
Src/zsh -fs 0.42s user 1.37s system 92% cpu 1.926 total
Src/zsh -fs 0.30s user 1.52s system 92% cpu 1.964 total
Peter's patch:
Src/zsh -fs 0.11s user 0.59s system 73% cpu 0.953 total
Src/zsh -fs 0.10s user 0.54s system 68% cpu 0.940 total
Src/zsh -fs 0.17s user 0.56s system 71% cpu 1.017 total
Src/zsh -fs 0.19s user 0.58s system 79% cpu 0.969 total
Src/zsh -fs 0.13s user 0.65s system 74% cpu 1.040 total
Src/zsh -fs 0.05s user 0.65s system 74% cpu 0.945 total
Src/zsh -fs 0.19s user 0.64s system 82% cpu 1.009 total
Src/zsh -fs 0.18s user 0.59s system 81% cpu 0.944 total
Src/zsh -fs 0.34s user 0.47s system 80% cpu 1.002 total
Src/zsh -fs 0.35s user 0.52s system 89% cpu 0.971 total
My "simpler" patch:
Src/zsh -fs 0.17s user 0.79s system 85% cpu 1.119 total
Src/zsh -fs 0.28s user 0.77s system 90% cpu 1.160 total
Src/zsh -fs 0.19s user 0.82s system 88% cpu 1.146 total
Src/zsh -fs 0.20s user 0.70s system 82% cpu 1.087 total
Src/zsh -fs 0.20s user 0.65s system 84% cpu 1.011 total
Src/zsh -fs 0.31s user 0.57s system 86% cpu 1.021 total
Src/zsh -fs 0.22s user 0.72s system 81% cpu 1.148 total
Src/zsh -fs 0.21s user 0.60s system 81% cpu 0.999 total
Src/zsh -fs 0.19s user 0.63s system 78% cpu 1.046 total
Src/zsh -fs 0.23s user 0.81s system 83% cpu 1.242 total
The additional speedup in PWS's patch is probably due to fewer stdio
function calls, and skip of the check for buffer overflow on every
character read.
I don't think the HAVE_FGETS + configure change is needed, there are
already at least four places where we assume fgets() is available.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author