From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22251 invoked by alias); 18 Oct 2015 20:40:47 -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: 36890 Received: (qmail 14212 invoked from network); 18 Oct 2015 20:40:45 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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 :content-type:content-transfer-encoding; bh=z357D2DEZbLy2rPti1jiDVMd58tDJ3PKOqCPHGOXCMA=; b=gQm590A7QgSHvpwGyoroZb+Ab2XnyYnpK+GOd0b2sk5KL6gSMJN9ntLpQGv2ZpuzXk ZBO1+QI3oUE+GGeKDWxUhn5D0PWT5RAmPbnMDY4PUMJ7XCIMM/44upqkHpbMpHTaOx9e WGlR8RvHz3+2hasqaSnVqKzkFiLTHaszhdUkO6I2mgCTBboyw+9uwwnTuaIla1W99j0F 259iY/1Kcf7O+DgPH5Gjg6cRde+adj054r8rorxpa5c6vVUJl0TGqoMvkx2VK1lrX+Bu kL/TdBGRy46HJJypAB0NWoSn7jI7vHXf2rZCKoKVRcUspc0BLvCMipIpkJv1TBKmPf3B EFew== X-Received: by 10.112.63.67 with SMTP id e3mr12777385lbs.92.1445200842241; Sun, 18 Oct 2015 13:40:42 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: 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> <151014213224.ZM15646@torch.brasslantern.com> <151015173554.ZM30733@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Sun, 18 Oct 2015 22:40:22 +0200 Message-ID: Subject: Re: Slowdown around 5.0.5-dev-0 To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 18 October 2015 at 18:19, Bart Schaefer wrot= e: > On Sat, Oct 17, 2015 at 2:12 AM, Sebastian Gniazdowski > wrote: >> On 16 October 2015 at 02:35, Bart Schaefer w= rote: >>> The array test only iterates 10000 times, the string test 50000 ? Does >>> that not account for the difference? >> >> Apparently not. I've modified the mem-test script so that it queries >> usage of memory also during the tests. It can be seen that for strings >> (and zsh 5.0.2) the memory is high from the beginning. > > I'm strongly inclined to think that's more likely an artifact of the > testing method than of the test itself have you tried running the > tests in the opposite order? The test script is quite well written. Here is how a test is being run: "$current_zsh" -c "source ./$0 $$ \"$current_zsh\" $test" & It starts new zsh process =E2=80=93 the one in "$current_zsh" variable =E2= =80=93 and feeds it with the same script file, giving in arguments pid of main Zsh, name of tested Zsh and name of test function to run. This should imply full separation of the tests. That's why order shouldn't matter. However I did reverse the order to just check and results are the same. The memory profile of three-patches version is thus: # string_test 41, 164, 279, 388, 504, 602, 707, last: 11 You are quite right that the memory usage isn't "high from the beginning". It starts from 41 MB, goes to 164, 279, etc. in quite controlled way. Previous version of the script awaited 3 seconds before doing first check, that's why it started from values of 100 MB, and I rather misinterpreted this. How to interpret these still high values is now open. > You also haven't explained your > reasoning for having the string test iterate so many more times than > the array test. Does it have to do with keeping total run time > similar? Yes that's the reason. I now do even more iterations to make the test last. During this time I query memory size, obtaining a nice sequence of memory usages. It nicely illustrates behavior of Zsh. >> It can be also seen that the recent three patches increase memory >> usage. A clean, free from the patches version of zsh >> (5.1.1-dev-0-clean) keeps the memory always low. > > That's entirely to be expected -- all three patches increase speed by > avoiding the work necessary to minimize memory footprint, until (as > you noted in next message) the execution stack is unwound. The script now computes averages. Average of 5.0.2 is 622.3, of two-patches version 327.7, of the three patches (third is the new heaps) 329.7. So it's better than without the patches, having in mind also the quick drop after stack is unwound. Tried a new test function: function_test() { local count if [ -z "$1" ]; then repeat 10000; do function_test 100; done _finished_signal_wait else count=3D"$1" fi if (( count -- > 0 )); then function_test "$count" fi } Its memory usage is low for all Zsh versions: ~2.5 MB, (e.g. 2.7, 2.9, 2.8, 2.6, 2.9, 2.8, 2.6, 2.9, 2.9, 2.8). Best Regards, Sebastian Gniazdowski