From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4115 invoked by alias); 7 May 2011 19:49:52 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29177 Received: (qmail 23338 invoked from network); 7 May 2011 19:49:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110507124945.ZM16028@torch.brasslantern.com> Date: Sat, 07 May 2011 12:49:45 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "Re: the source of slow large for loops" (May 7, 9:21pm) References: <110507121112.ZM9261@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: the source of slow large for loops MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On May 7, 9:21pm, Mikael Magnusson wrote: } } > You need to look at how much time something takes, not } > just how often it's done. } } Yeah, I actually tried gprof first, but I was unable to start zsh } then, it just exited with "profile signal" or something like that. All I did was start up the loop and then repeatedly connect to the program with gdb and look at the stack trace. Five times out of six it was in freeheap() when I attached. :-) Unfortunately my patch doesn't help with the pathological behavior of ary+=(elem).