Zsh Mailing List Archive
Messages sorted by:
Re: One more heap optimization trick for zsh < 5.2
- X-seq: zsh-users 21645
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: One more heap optimization trick for zsh < 5.2
- Date: Fri, 10 Jun 2016 20:30:56 -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=q61Pz0IH98Je2/r4po6JOw44Xg7AO63SWMgw3IMEuaw=; b=MT3emIrcmepAt2pWm7gZv1G//yH2TuGYXpgt+gi79UGTzyEoOZfrr1AjfFpBClDMc+ LsPY7epUsqO/lV3WZWOEvVyk6+e9xpTpHDroa6yYRpyAE9/cOJUrzC6LH35C63IqJKqB /nObrhK0NMvKJ9RQBcS+FGmHEDyhyYAGpFMHTxKdeGxq86IlLItgav+yku+8rF1mE3F2 SbLdc62s+OmDKasLiOHXLVfxlLraiFIA68cHPA47oH9g5urhNa6hp6UVAejkel4UAVNs P+VH6+VV47tWlIBJtonEgZ4sPsFYCPzbQvh/R68Rr0VzU+MNnQ9xPXL4zU9+xR9yE3VV pr1w==
- In-reply-to: <CAKc7PVDaLHs3xEVJGFn1F2M0BEEOzZFt8enMis7tTmbVKLx12Q@mail.gmail.com>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVDRk2hx9i0T62fnD=v__1RbB9sPr5ni_mHXLojVa4sotA@mail.gmail.com> <160508093530.ZM9686@torch.brasslantern.com> <CAKc7PVDaLHs3xEVJGFn1F2M0BEEOzZFt8enMis7tTmbVKLx12Q@mail.gmail.com>
On May 16, 5:01pm, Sebastian Gniazdowski wrote:
} Subject: Re: One more heap optimization trick for zsh < 5.2
} I was testing the same input with 89k lines. The cause now
} accidentally clarified. It's about zplugin's shadowing of autoload
I was writing this off until I noticed that it's not just that the
first n-list takes a long time to begin, but that every motion in
the zcurses display takes a long time to update the viewport.
This means that it has to be something that's happening in the loop
inside the n-list function, affecting every iteration.
Consequently it must be one of n-list-input or n-list-draw, both of
which are declared with [the shadowed] autoload inside n-list itself.
Something about nesting calls to --zplg-reload-and-run is causing
the issue. It might have something to do with retaining the old copy
of the function body until the call stack unwinds and it can safely
be freed; a large value for $argv would therefore also hang around
(two copies of it) for all of that time.
Incidentally, the way n-list is currently written, it will re-autoload
those functions and re-create all the _nlist_* helpers EVERY TIME IT
IS RUN. Mostly that's all of no net effect, but it must be slowing
down each call to n-list at least a little bit.
Anyway, once n-list has run at least once, n-list-draw and n-list-input
are fully defined without --zplg-reload-and-run, so the slowdown during
the loop goes away. I still don't know exactly *why* this would make
any difference, but a zprof pass *might* reveal something useful.
Messages sorted by: