zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: ZSH performance regression in 5.8.1.2-test
Date: Thu, 28 Apr 2022 01:18:37 +0900	[thread overview]
Message-ID: <05F08D90-85FB-4A92-BC57-B56EA4177EC6@kba.biglobe.ne.jp> (raw)
In-Reply-To: <CAH+w=7bhgAtXnT5xTDS+d=y0ea6pAXbPMUoUQ27vyk6JXTGL1Q@mail.gmail.com>


> 2022/04/28 0:25, Bart Schaefer <schaefer@brasslantern.com> wrote:
> 
> On Wed, Apr 27, 2022 at 7:00 AM Jun T <takimoto-j@kba.biglobe.ne.jp> wrote:
>> 
>> (3) time zsh -f < tmp.txt
> 
> Does it matter to (3) if "zsh -fs" ?

No, no noticeable difference.

>> With lseek() patch we get "reasonable" performance for (1)-(4).
>> (3) is somewhat slower, because it is reading form stdin and
>> need to call lseek() many times.
> 
> I wonder if it would help to read less than SHINBUFSIZE when
> SHINSTDIN.  E.g., make some guess at the "average line length" and
> read that many bytes.  Might cause more calls to memchr() but less I/O
> (and shorter lseek()s, if that matters).

I tried setting SHINBUFSIZE to 80 for (3) (with lseek() patch):
SHINBUFSIZE=8192  about 1.3 sec
SHINBUFSIZE=80    about 1.2 sec    (slight improvement)
(I'm now using a different Mac from the one used in the previous post)

I guess data is cached by the OS and read() is, in most cases, something
like memcpy(). I was running the test on a internal SDD of my iMac, but
running the test on a external HDD gives almost the same results.
If the file is on a "much slower" filesystem then the difference may be
somewhat larger.


  reply	other threads:[~2022-04-27 16:19 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 18:16 Jordan Patterson
2022-04-25 18:56 ` Bart Schaefer
2022-04-25 19:20   ` Stephane Chazelas
2022-04-25 21:27     ` Bart Schaefer
2022-04-26  7:01       ` Bart Schaefer
2022-04-26  8:31         ` Peter Stephenson
2022-04-27  0:33           ` Bart Schaefer
2022-04-27 14:11           ` Stephane Chazelas
2022-04-27 15:02             ` Bart Schaefer
2022-04-27 15:07               ` Peter Stephenson
2022-04-27 15:17                 ` Bart Schaefer
2022-04-26 14:31         ` Jun. T
2022-04-26 15:15           ` Peter Stephenson
2022-04-27  0:55             ` Bart Schaefer
2022-04-27  9:16               ` Jun T
2022-04-27  0:38           ` Bart Schaefer
2022-04-27  9:34             ` Peter Stephenson
2022-04-27 10:28               ` Jun T
2022-04-27 12:42                 ` Jun T
2022-04-27 13:58                 ` Jun T
2022-04-27 15:25                   ` Bart Schaefer
2022-04-27 16:18                     ` Jun. T [this message]
2022-04-27 19:54         ` Jordan Patterson
2022-04-28  9:53           ` Jun T
2022-04-28 14:56             ` Bart Schaefer
2022-04-28 18:51           ` Jun. T
2022-04-29  0:28             ` Bart Schaefer
2022-04-29  2:25               ` Jun. T
2022-04-26  1:08 ` Bart Schaefer
2022-04-26  3:03   ` Jordan Patterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05F08D90-85FB-4A92-BC57-B56EA4177EC6@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).