From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10446 invoked by alias); 16 May 2016 15:01:53 -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: 21568 Received: (qmail 14253 invoked from network); 16 May 2016 15:01:51 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cKNaYCJGOuZpsWYTxBGBvuHrRFCyC7nlJI6Gm8H07qY=; b=yqdz9WgPo8wEeotLfjJO3+3U6nrAxFiHgRktzevb+sc6KVe3LP5BQS5erYLpEcxEhi Vi6g+V7DSW0+/libFQfQllJpShdRMd3sQ3Xq3byB6At3PL8SZNFdfdML1F/Nx3BhDEYi TIhOej0LWz68UhDxo4z53usE0BFL8jj0NFPka6Hai+DsuhhWQLQGLU8dvGm8FUV0I+8W US5l4x9GGwx+ofgcHwyBg4oqi0YL7bxulpbNHAeopgxNrhJWA5hOoCjwk8jSaSIylP1G +PAc2SUgz+g+n/aM2E0Y6bfDntQgKa1WR32d4FcmF8xHfuhd4iw55XX0GkkPfeXjuaEx 0gkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cKNaYCJGOuZpsWYTxBGBvuHrRFCyC7nlJI6Gm8H07qY=; b=WPHEYa/M/h3YVfy/kptyKHW5THARqk5z4uFJZItK4pPCd784Z1381q01Qn2MFlff+7 j3MVeJs7/3GRLTdvwCJ1WVOyY+DDNJehCDkcuvpMlE97o4pLnGnTm0JoMS/2E7GpJNe7 yv6oXl50vjmuhfAbaAnKpOdqUAKH1hU2ilx7QONkGNxrwGLMft+SagbXMzenrVFbLjKO pPZAMvGg5oEmRb70i718z+Fuv9RmacqN/JuJ+X2kkWVSJ874mUD+ziC+LoVw8SML7ndd IOLhNKhVd1Vcr7t5KBYqUw9z96GEbTOC2nkPJG1oKBcbCkdpxY6mjWkcJiba3If8fLKi Hl2Q== X-Gm-Message-State: AOPr4FVl6nqirTiTUE93BJekMvVIAAnDbGvHFIMowwJ31s2B9nCt3zcafZgHP+VxMBEzQyg6614lJvAVvPfqxg== X-Received: by 10.112.27.233 with SMTP id w9mr11588164lbg.86.1463410907889; Mon, 16 May 2016 08:01:47 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <160508093530.ZM9686@torch.brasslantern.com> References: <160508093530.ZM9686@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Mon, 16 May 2016 17:01:28 +0200 Message-ID: Subject: Re: One more heap optimization trick for zsh < 5.2 To: Bart Schaefer Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On 8 May 2016 at 18:35, Bart Schaefer wrote: > If the size of $list is indeed the deciding factor here, I would > suspect that you're now running into heap management during the > pattern match against $~search_pattern, and there's really nothing > at the level of shell coding that can change pattern match behavior. I was testing the same input with 89k lines. The cause now accidentally clarified. It's about zplugin's shadowing of autoload function that does the neat trick that allows to copycat what autoload does: # declare -f n-list n-list () { --zplg-reload-and-run /Users/sgniazdowski/.zplugin/plugins/psprint---zsh-navigation-tools '' n-list "$@" } https://github.com/psprint/zplugin/blob/28b615c6d728b22ec87a86026e7a463d731184ae/zplugin.zsh#L273-L287 First run is slow, second is normal and fast: https://asciinema.org/a/99ercap3i6nri6ybiiayd0ejb It's hard to describe what *reload-and-run does but you are the author of this neat trick so I can skip this. How do you think what can be happening inside Zsh? Best regards, Sebastian Gniazdowski