From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23210 invoked by alias); 4 Dec 2015 17:43:32 -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: 37309 Received: (qmail 16585 invoked from network); 4 Dec 2015 17:43:31 -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,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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:content-type; bh=jVz9KNCoA/Zfqt8hVO17RzRWZA9okmcAkn26WVgUrlE=; b=LiCOf0zKWZi1C2Ee+NX/zHBg+ae3+jDdbIgZYDjzy21L9kIu752w6GRgfd0BFCpRyJ O69hZQ9LQ/eOYZ0Sa+VaoEzoqzMIWurKz20dsoiyyvRgDZKD5Rdl3D7p2x8n7zMgtafs FuIJnKIXdUa7XUFL2cai7wXHWaqG8o8mzakuQv6Nl2bsvBUXOMFx3rbcb5wFhlS87z8/ VBT79E/MqXWNL4w41/5g/WCiRoy6Kigy9UcC190T06OiNST+vm9b7apkw9gXXViyNZff Of8JJbMdV3nhKrIOMGMvdk671Ar63AWsZyz5PV5YUBNd0kByLtQmhtmX6bcosBBwfWi1 iBHw== 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=jVz9KNCoA/Zfqt8hVO17RzRWZA9okmcAkn26WVgUrlE=; b=f+8dr7YnGU/hwgFnJ8ytcMBIeOGudChryMDObtnwMKr2xyJwfTgorhGZhWuPZH4JII eMob8Psb8K6N+gVKeNUmOyZXefYcSH2TWzoxpAN/vQLU9QMrQ3EhI3ibNSZ7zMb2zUHs hgoPYg/z1HHszorfx5c1IzUajpqrLvRX5+CynjN/eWIdurEF/Tzdj7kJrkicBBLn5qON TZtzhrm/blu/rsaf3enuhxHQ9fWreClPxHUF+/7U3v8Og7evo4sZlYDXaTWGLpojvLs/ /71VHtifHoU85a+lKjADS9Je6bluYQl43Vicmhd4rj1lW4AaDCO0gfK70qq/Xf93xKeh ulTw== X-Gm-Message-State: ALoCoQnWhU1t0RkgtgyYNO4jRFTIsgrdUXegztXlUwwQhjUyREWZx+lPmoTs67DLQTjUsE+Sj53J X-Received: by 10.66.153.139 with SMTP id vg11mr23393446pab.118.1449251009595; Fri, 04 Dec 2015 09:43:29 -0800 (PST) From: Bart Schaefer Message-Id: <151204094331.ZM16171@torch.brasslantern.com> Date: Fri, 4 Dec 2015 09:43:31 -0800 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Single-run while makes script fast" (Dec 4, 5:20pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: Single-run while makes script fast MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Dec 4, 5:20pm, Sebastian Gniazdowski wrote: } } I attach animated gif showing the effect. The while loop in following } code makes whole script fast: By code examination rather than actual experiment -- The difference when the while-loop is introduced is that the entire heap allocated by body=(...) is discarded with a single popheap() at the "done", whereas without the loop the space is reclaimed by a call to freeheap() which has to examine every heap arena. You should be able to get the same effect with "repeat 1" so as not to need the loop-counter variable. This might indicate that the exec*() routines in Src/loop.c are not doing as much as they could to keep memory footprint to its minimum.