From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3611 invoked by alias); 15 Oct 2015 04:32:31 -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: 36860 Received: (qmail 8714 invoked from network); 15 Oct 2015 04:32:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 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:content-type; bh=WQMCnuibYTwn3H4/vTc9MolNFS+nKuV5atuI5l2tVo4=; b=NCTKryb0OiVybx733Cc5dK3I8eose8N3axqnTbydUGJXzoobuZiCWRwu8kOshDkwuc +xH3vBT3TO6zqbq4GxD1FfoPsmocXjPbjIfBCYvDcA5h6cWWJrJsQha5uSuHZEMHkX74 92ZuhRF44e03ldwQuKnufhdNNp5n31vfRSKHtzmlKF7LTplD+BndIug337vyK+kcgnAh 8v7LJXmHt2fDZ76LJImcPsn8OLGwvomc8HCsrim+SPKuCEI55JGx3IRJNpTtGxVh0Wgg Fy4CyvIEEZXxJ4IV6IbplBi9UARcuPkXyUMdN4gNAg5hK33JbxPO0YIUG0PRxu5XPQ7+ OZUg== X-Gm-Message-State: ALoCoQkNQtTFB6JZeRrkBWzudSK0gLHG+6XHc3Utr/iiKNYf7rnuR24O3gxnpUxRGshty+z4+J6T X-Received: by 10.60.79.226 with SMTP id m2mr4511260oex.20.1444883548024; Wed, 14 Oct 2015 21:32:28 -0700 (PDT) From: Bart Schaefer Message-Id: <151014213224.ZM15646@torch.brasslantern.com> Date: Wed, 14 Oct 2015 21:32:24 -0700 In-Reply-To: <151014095009.ZM19954@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Slowdown around 5.0.5-dev-0" (Oct 14, 9:50am) References: <151010105849.ZM10144@torch.brasslantern.com> <151010170623.ZM16166@torch.brasslantern.com> <151010232045.ZM12931@torch.brasslantern.com> <151011091757.ZM27755@torch.brasslantern.com> <151011103121.ZM8814@torch.brasslantern.com> <151011142204.ZM9103@torch.brasslantern.com> <151012070105.ZM15099@torch.brasslantern.com> <151012173304.ZM15477@torch.brasslantern.com> <151013085246.ZM30504@torch.brasslantern.com> <20151014142722.282d0c5a@pwslap01u.europe.root.pri> <151014092536.ZM32511@torch.brasslantern.com> <151014095009.ZM19954@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Slowdown around 5.0.5-dev-0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 14, 9:50am, Bart Schaefer wrote: } Subject: Re: Slowdown around 5.0.5-dev-0 } } On Oct 14, 9:25am, Bart Schaefer wrote: } } } } NEWHEAPS() is O(1) where pushheap() is O(N) where N is the number of } } arenas [...] the question is would it slow down in the more normal use } } case of a mostly-empty heap and a lot of function calls } } Just as a data point, I tried swapping out the push/pop pair in the } source() function with NEWHEAPS/OLDHEAPS [...] } NEWHEAPS was slightly slower I've now gone through all the pushheap() in the code ... after ruling out the cases where the code between push and pop couldn't be neatly wrapped as a { block }, the only other pair it might make sense to replace is in sort.c:strmetasort() and even that is questionable. Given that we have direct evidence that it's beneficial to use NEWHEAPS in doshfunc() in at least one case, I'll go ahead and commit 36853 and we can see how it goes.