zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: Slowdown around 5.0.5-dev-0
Date: Sun, 18 Oct 2015 22:40:22 +0200	[thread overview]
Message-ID: <CAKc7PVAX465ikPrPN3LqhA+0Kb9FN3d6TsgV34oq8nd=RN_F6A@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7apKAb30VJR9vOCLA+o8A1tEJYN=rkkqHOtuj=+7TvyUg@mail.gmail.com>

On 18 October 2015 at 18:19, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Sat, Oct 17, 2015 at 2:12 AM, Sebastian Gniazdowski
> <sgniazdowski@gmail.com> wrote:
>> On 16 October 2015 at 02:35, Bart Schaefer <schaefer@brasslantern.com> wrote:
>>> 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 – the one in "$current_zsh" variable – 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="$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


  reply	other threads:[~2015-10-18 20:40 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-10 10:54 Sebastian Gniazdowski
2015-10-10 17:58 ` Bart Schaefer
2015-10-10 18:11   ` Sebastian Gniazdowski
2015-10-10 18:32     ` Sebastian Gniazdowski
2015-10-11  0:06       ` Bart Schaefer
2015-10-11  6:20         ` Bart Schaefer
2015-10-11  8:39           ` Sebastian Gniazdowski
2015-10-11 16:17             ` Bart Schaefer
2015-10-11 16:48               ` Sebastian Gniazdowski
2015-10-11 17:31                 ` Bart Schaefer
2015-10-11 18:05                   ` Sebastian Gniazdowski
2015-10-11 21:22                     ` Bart Schaefer
2015-10-12  8:21                       ` Sebastian Gniazdowski
2015-10-12 14:01                         ` Bart Schaefer
2015-10-12 16:50                           ` Sebastian Gniazdowski
2015-10-13  0:33                             ` Bart Schaefer
2015-10-13  8:21                               ` Sebastian Gniazdowski
2015-10-13 15:52                                 ` Bart Schaefer
2015-10-14  6:50                                   ` Sebastian Gniazdowski
2015-10-14 13:27                                   ` Peter Stephenson
2015-10-14 16:25                                     ` Bart Schaefer
2015-10-14 16:50                                       ` Bart Schaefer
2015-10-15  4:32                                         ` Bart Schaefer
2015-10-15 13:03                                           ` Sebastian Gniazdowski
2015-10-16  0:35                                             ` Bart Schaefer
2015-10-17  9:12                                               ` Sebastian Gniazdowski
2015-10-17  9:24                                                 ` Sebastian Gniazdowski
2015-10-18 16:19                                                 ` Bart Schaefer
2015-10-18 20:40                                                   ` Sebastian Gniazdowski [this message]
2015-10-18 21:07                                                     ` Bart Schaefer
2015-10-18 21:31                                                       ` Sebastian Gniazdowski
2015-10-19 17:21                                                         ` Bart Schaefer
2015-10-22 12:49                                                           ` Sebastian Gniazdowski
2015-10-22 15:00                                                             ` Bart Schaefer
2015-10-22 16:28                                                               ` Sebastian Gniazdowski
2015-10-22 16:33                                                                 ` Sebastian Gniazdowski
2015-10-23 15:40                                                               ` Sebastian Gniazdowski
2015-10-23 15:57                                                                 ` Sebastian Gniazdowski
2015-10-23 19:26                                                                   ` Bart Schaefer
2015-10-23 23:50                                                                     ` Bart Schaefer
2015-10-24  6:09                                                                       ` Sebastian Gniazdowski
2015-10-24  7:37                                                                         ` Sebastian Gniazdowski
2015-10-24  8:04                                                                           ` Sebastian Gniazdowski
2015-10-24 19:39                                                                           ` Bart Schaefer
2015-10-25  7:35                                                                             ` Sebastian Gniazdowski
2015-10-25 17:23                                                                               ` Bart Schaefer
2015-10-25 20:56                                                                                 ` Sebastian Gniazdowski
2015-10-26  0:49                                                                                   ` Bart Schaefer
2015-10-26  7:41                                                                                     ` Sebastian Gniazdowski
2015-10-26  7:47                                                                                       ` Sebastian Gniazdowski
2015-10-24  6:27                                                                       ` Sebastian Gniazdowski
2015-10-24 10:54                                                                       ` Sebastian Gniazdowski
2015-10-24 11:25                                                                         ` Sebastian Gniazdowski
2015-10-24 16:31                                                                         ` Bart Schaefer
2015-10-24 16:41                                                                           ` Bart Schaefer
2015-10-23  6:32                                                             ` Sebastian Gniazdowski
2015-10-16  0:37                                             ` Bart Schaefer
2015-10-13 13:07                         ` Sebastian Gniazdowski
2015-10-13 13:31                           ` Sebastian Gniazdowski
2015-10-12 12:05                       ` Sebastian Gniazdowski
2015-10-12 15:13                         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKc7PVAX465ikPrPN3LqhA+0Kb9FN3d6TsgV34oq8nd=RN_F6A@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).