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

Re: ZSH performance regression in 5.8.1.2-test



> 2022/04/28 0:25, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 
> On Wed, Apr 27, 2022 at 7:00 AM Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> 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.




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