From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22314 invoked by alias); 11 Jun 2016 03:30:48 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21645 Received: (qmail 10634 invoked from network); 11 Jun 2016 03:30:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=q61Pz0IH98Je2/r4po6JOw44Xg7AO63SWMgw3IMEuaw=; b=VR6YkxK/1kC7PRV8jSFqh0/EUChDX1Ajdzbbc3h8eAdPlkCDfHVGrMKPQ8fceqjFlw Nalto1h2MmE8xaLYlC2lCaHprZMQeUs3GvQal1UaHGf01doji7F92N8OYAu98qhlpfen UydEJZjmGNgS5VyM5sM5ZPnchQQ3udAVqdTreg5/V7nujokN63FYpcjRmKvBh6+qaCzH 1l7PgDCOw3JVgYAIHIJ3Bq1fiS4FzMLQGlouxiE5SqVYhVcky0+iEIn2cXjf2pafhEXI 45hXNWqy7S5vzLlfZagQcjQyan2Fzn8b/BbUs7HFLGWNvKaB99w5iolcHgq4CFlmusXx HZ6w== X-Gm-Message-State: ALyK8tKICu4LzK8IEqtuYjogbUmuZFtKz1rzfbPQK0ObfXoW6WnEOIA5ge3lckL4tFGdyw== X-Received: by 10.66.25.231 with SMTP id f7mr6092213pag.65.1465615843477; Fri, 10 Jun 2016 20:30:43 -0700 (PDT) From: Bart Schaefer Message-Id: <160610203056.ZM10515@torch.brasslantern.com> Date: Fri, 10 Jun 2016 20:30:56 -0700 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: One more heap optimization trick for zsh < 5.2" (May 16, 5:01pm) References: <160508093530.ZM9686@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: One more heap optimization trick for zsh < 5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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.