Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Slowdown around 5.0.5-dev-0



On 18 October 2015 at 23:07, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Sorry, I didn't mean order of zsh versions, I meant did you try doing
> array_test before string_test within each version.

That's what I did

> String is stored as one contiguous block of bytes, so each time it exceeds
> the size of the current heap block an entire new large-enough block is
> allocated, and no previous block can never be re-used because the string
> never shrinks.

How can 5.1.1-dev-0 with no patches maintain low memory usage for strings then?

# string_test 3.3, 7.8, 9.4, 11, 11, 11, 11, 11, 11, 12, 11, 12, 11,
12, last: 11

> For functions the test would also need to compare run time / CPU usage - I
> would not expect memory usage to be interesting unless the function declared
> locals.

The function test has two samples more (7 vs. 9), taken in intervals
of 3 seconds, so there is a difference.

Best regards,
Sebastian Gniazdowski
# Tests for zsh
# array_test 1.5, 2.6, 3.3, 4, 4.5, 4.8, 5.7, 6.4, 7.5, 7.9, 8.1, 8.4, 8.7, 8.9, last: 9
array_test 5.6
# string_test 361, 509, 608, 676, 728, 771, 806, last: 836
string_test 608.8
# function_test 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, last: 2.7
function_test 2.7


# Tests for zsh-head-both
# array_test 1.5, 2.6, 3.2, 4, 4.3, 4.8, 6, 7, 7.7, 8.2, 8.4, 8.7, 9, last: 9.1
array_test 5.5
# string_test 44, 173, 302, 431, 560, 681, last: 10
string_test 302.0
# function_test 2.5, 2.6, 2.6, 2.5, 2.6, 2.6, 2.6, last: 2.5
function_test 2.6

# Tests for zsh-newheaps-three-patches
# array_test 1.5, 2.7, 3.4, 3.9, 4.3, 4.8, 5.9, 6.6, 7.6, 8, 8.3, 8.6, 8.9, 9.1, last: 9.1
array_test 5.7
# string_test 46, 173, 290, 402, 511, 614, 707, last: 10
string_test 339.3
# function_test 2.9, 2.8, 2.6, 2.6, 2.8, 2.7, 2.6, 2.8, 2.9, last: 2.6
function_test 2.7

# Tests for zsh-5.1.1-dev-0-clean
# array_test 1.5, 2.6, 3.3, 4, 4.5, 5, 6.3, 7, 7.9, 8.2, 8.5, 8.7, 9, last: 9.1
array_test 5.6
# string_test 3.1, 7.3, 9, 11, 11, 11, 11, 11, 11, 12, 11, 12, 12, 11, last: 11
string_test 10.2
# function_test 2.6, 2.5, 2.6, 2.6, 2.6, 2.6, 2.5, last: 2.5
function_test 2.6



Messages sorted by: Reverse Date, Date, Thread, Author