zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: zsh 5.1.1-test-1
Date: Sun, 22 Nov 2015 11:54:18 +0100	[thread overview]
Message-ID: <CAKc7PVAXAPWacNWj6MsnPqttNre+cpcE12x9n60v1ygZX4QvAw@mail.gmail.com> (raw)
In-Reply-To: <20151121183514.527eccf6@ntlworld.com>

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

Test suite runs fine on OS X 10.11.1. I've build two versions, without
pcre and with it (so that V07pcre.ztst could be ran).

I also ran my performance and memory test against pcre test1, slightly
earlier version (d5ba08a) with no pcre and 5.0.2, results are good.

Best regards,
Sebastian Gniazdowski

On 21 November 2015 at 19:35, Peter Stephenson
<p.w.stephenson@ntlworld.com> wrote:
> I've upoloaded a test version 5.1.1-test-1 preparatory to releasing
> 5.2.  You can find it at
>
> http://www.zsh.org/pub/development/
>
> and also as a tag in the repository.
>
> I'm not expecting unexpected problems, but then logically I can't, so
> let me know.
>
> pws

[-- Attachment #2: test1_mem_results.txt --]
[-- Type: text/plain, Size: 1208 bytes --]

# Tests for zsh-5.1.1-test-1
# string_test 6.6, 9.7, 12, 12, 12, 13, 12, 12, last: 11
string_test 11.0
# array_test 1.5, 2.4, 3.1, 3.5, 3.9, 4.3, 4.6, 5.1, 6, 6.7, 7.4, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, last: 9.2
array_test 5.9
# function_test 2.7, 2.5, 2.7, 2.8, 2.5, 2.5, 2.6, 2.6, 2.6, 2.8, 2.6, 2.8, last: 2.4
function_test 2.6
# search_test 111, 196, last: 274
search_test 111.0


# Tests for zsh-5.0.2
# string_test 73, 161, 217, 262, 300, 334, 364, 392, 417, 440, 463, 483, 505, 522, 541, 557, 573, last: 586
string_test 376.9
# array_test 1.5, 2.4, 3, 3.5, 3.8, 4.3, 4.4, 4.9, 5.8, 6.5, 7.2, 7.6, 8, 8.2, 8.4, 8.6, 8.8, 9, last: 9
array_test 5.7
# function_test 2.4, 2.4, 2.4, 2.5, 2.5, 2.5, 2.4, 2.4, 2.5, last: 2.4
function_test 2.4
# search_test 62, 108, 138, 162, 183, 202, 220, 237, last: 245
search_test 153.6


# Tests for zsh-d5ba08a-clean
# string_test 6.3, 9.4, 11, 11, 12, 12, 12, 12, last: 11
string_test 10.5
# array_test 1.6, 2.4, 3, 3.5, 4, 4.4, 4.5, 5.2, 6.1, 6.7, 7.4, 8.1, 8.3, 8.5, 8.7, 8.8, 9.1, 9.2, last: 9.2
array_test 5.9
# function_test 2.8, 2.5, 2.8, 2.8, 2.8, 2.5, 2.6, 2.5, 2.8, 2.6, 2.6, last: 2.5
function_test 2.7
# search_test 111, 190, 251, last: 264
search_test 150.5


[-- Attachment #3: test1_perf_results.txt --]
[-- Type: text/plain, Size: 807 bytes --]

Running [zsh-5.1.1-test-1]:              string_test       1602,18
Running [zsh-5.0.2]:                     string_test       4211,40
Running [zsh-d5ba08a-clean]:             string_test       1641,52

Running [zsh-5.1.1-test-1]:              array_test        4920,74
Running [zsh-5.0.2]:                     array_test        5126,64
Running [zsh-d5ba08a-clean]:             array_test        5041,16

Running [zsh-5.1.1-test-1]:              function_test    13866,95
Running [zsh-5.0.2]:                     function_test    11229,21
Running [zsh-d5ba08a-clean]:             function_test    13736,76

Running [zsh-5.1.1-test-1]:              search_test       2532,93
Running [zsh-5.0.2]:                     search_test       4653,87
Running [zsh-d5ba08a-clean]:             search_test       2471,28

[-- Attachment #4: perf-test.zsh --]
[-- Type: application/octet-stream, Size: 2143 bytes --]

#!/bin/zsh

emulate -L zsh
setopt extendedglob

zmodload zsh/zprof

zshs=( zsh-5.1.1-test-1 zsh-5.0.2 zsh-d5ba08a-clean )

#
# Children administration
#

trap "finished" SIGUSR1

finished() {
    FINISHED=1
}

# Waits for signal from child process
wait_for_end_of_test() {
    while [ "$FINISHED" -eq 0 ]; do
        sleep 1
    done
    kill -15 "$SUB_PID"
}

_finished_signal_wait() {
    kill -SIGUSR1 "$MAIN_PID"
    sleep 60
}

#
# Tests
#

tests=( string_test array_test function_test search_test )
#tests=( string_test array_test )

float multiplier=0.3

string_test() {
    local a=""
    integer i=$(( 150000*multiplier ))
    repeat $i; do a+="$i"; done
}

array_test() {
    typeset -a a
    integer i=$(( 25000*multiplier ))
    repeat $i; do a+=( $i ); done
}

function_test() {
    local count
    integer i=$(( 10000*multiplier ))

    if [ -z "$1" ]; then
        repeat $i; do function_test 100; done
    else
        count="$1"
    fi

    if (( count -- > 0 )); then
        function_test "$count"
    fi
}

search_test() {
    integer elements=$(( 800000 * multiplier ))
    a="${(r:elements:: _:)b}"
    a=( $=a )
    a=( "${(@M)a:#(#i)*_*}" )
    a=( "${(@)a//(#mi)(_|a)/-${MATCH}-}" )
    a=( "${(@)a//(#bi)(_|-)/|${match[1]}|}" )
}

#
# Main code
#

# Detect main vs. for-test invocation
if [ -z "$1" ]; then

    for test in "$tests[@]"; do
        for current_zsh in "$zshs[@]"; do

            type "$current_zsh" 2>/dev/null 1>&2 || { echo >&2 "Skipping non-accessible $current_zsh"; continue }
            zsh_binary="${current_zsh##*/}"
            FINISHED=0
            TEST="$test"

            "$current_zsh" -c "source ./$0 $$ \"$current_zsh\" $test" &

            SUB_PID=$!
            wait_for_end_of_test
        done

        echo

    done

else
    MAIN_PID="$1"
    zsh_binary="${2##*/}"
    shift
    shift
    txt="Running [$zsh_binary]: "
    echo -n "${(r:40:: :)txt}" "${(r:15:: :)*}"

    # Run the test
    zprof -c
    "$@"
    zprof_out=( "${(@f)"$( zprof )"}" )
    zprof_out="$zprof_out[3]"
    zprof_out=( $=zprof_out )
    echo "${(l:10:: :)zprof_out[3]}"

    _finished_signal_wait
fi

[-- Attachment #5: mem-test.zsh --]
[-- Type: application/octet-stream, Size: 4001 bytes --]

#!/bin/zsh

emulate -L zsh
setopt extendedglob

zshs=( zsh-5.1.1-test-1 zsh-5.0.2 zsh-d5ba08a-clean )

# Convert sizes to number of megabytes
to_mbytes() {
    local size="$1"
    #echo Converting: "$1"
    if [[ "$size" = [0-9]#[Mm]* ]]; then
        size="${size%[Mm]*}"
    elif [[ "$size" = [0-9]#[Kk]* ]]; then
        size="${size%[Kk]*}"
        (( size = size / 1024.0 ))
    elif [[ "$size" = [0-9]# ]]; then
        case $( uname ) in
            *Linux*)
                (( size = size / 1024.0 ))
                ;;
            *)
                (( size = size / (1024.0 * 1024.0) ))
                ;;
        esac
    else
        echo "Bad size occured: $size"
    fi

    REPLY="$size"
}

#
# Children administration
#

trap "finished" SIGUSR1

finished() {
    FINISHED=1
}

# Gets memory size of the zsh that runs the test
get_mem() {
    case $( uname ) in
        *Darwin*)
            output=( "${(@f)"$( top -pid "$SUB_PID" -stats mem -l 1 )"}" )
            to_mbytes "$output[-1]"
            ;;
        *Linux*)
            output=( "${(@f)"$( top -p "$SUB_PID" -bn 1 )"}" )
            output=$output[-1]
            output=( $=output )
            to_mbytes "$output[6]"
            ;;
    esac
}

# Waits for signal from child process
wait_get_mem() {
    local number
    float average=0.0
    integer count=0

    echo -n "# $TEST "

    sleep 1
    while [ "$FINISHED" -eq 0 ]; do
        get_mem
        number=`LANG=C printf "%.1f" "$REPLY"`
        echo -n "${number%.0}, "

        average+=number
        count+=1
        sleep 3
    done

    # Remove last result - to be certain that the average
    # is only above data from actively working test function
    if [ "$count" -gt 1 ]; then
        average=average-number
        count=count-1
    fi
    average=average/count

    # Take the explicit last result, it's telling
    # how zsh behaves when computation is stopped
    sleep 1
    get_mem
    number=`LANG=C printf "%.1f" "$REPLY"`
    echo "last: ${number%.0}"
    kill -15 "$SUB_PID"

    # Suitable for gnuplot - X Y
    LANG=C printf "$TEST %.1f\n" $average
}

_finished_signal_wait() {
    kill -SIGUSR1 "$MAIN_PID"
    sleep 60
}

#
# Tests
#

tests=( string_test array_test function_test search_test )

string_test() {
    local a=""
    integer i=150000
    repeat $i; do a+="$i"; done

    _finished_signal_wait
}

array_test() {
    typeset -a a
    integer i=25000
    repeat $i; do a+=( $i ); done

    _finished_signal_wait
}

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
}

search_test() {
    integer elements=700000
    a="${(r:elements:: _:)b}"
    a=( $=a )
    a=( "${(@M)a:#(#i)*_*}" )
    a=( "${(@)a//(#mi)(_|a)/-${MATCH}-}" )
    a=( "${(@)a//(#bi)(_|-)/|${match[1]}|}" )

    _finished_signal_wait
}

#
# Main code
#

# Detect main vs. for-test invocation
if [ -z "$1" ]; then
    for current_zsh in "$zshs[@]"; do
        type "$current_zsh" 2>/dev/null 1>&2 || { echo >&2 "Skipping non-accessible $current_zsh"; continue }
        zsh_binary="${current_zsh##*/}"

        echo "# Tests for $zsh_binary"
        for test in "$tests[@]"; do
            FINISHED=0
            TEST="$test"

            "$current_zsh" -c "source ./$0 $$ \"$current_zsh\" $test" &

            SUB_PID=$!
            wait_get_mem
        done
        echo
        echo

    done

    # Example gnuplot invocation:
    #set style data histogram
    #set style fill solid border rgb "black"
    #plot "result" index 0 using 2: xtic(1), "result" index 1 using 2: xtic(1), "result" index 2 using 2: xtic(1)
else
    MAIN_PID="$1"
    zsh_binary="${2##*/}"
    shift
    shift
    # Echo status only when output is not to terminal
    [ ! -t 1 ] && echo >&2 "Running [$zsh_binary]: $@"

    # Run the test
    eval "run_test() { $@ }"
    run_test
fi

  parent reply	other threads:[~2015-11-22 10:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-21 18:35 Peter Stephenson
2015-11-21 18:54 ` Pascal Wittmann
2015-11-21 19:09 ` Simon Ruderich
2015-11-21 22:25   ` Bart Schaefer
2015-11-22 14:31   ` Christian Heinrich
2015-11-22 15:31   ` Peter Stephenson
2015-11-24  7:41     ` Simon Ruderich
2015-11-21 23:01 ` Test/V01private.ztst skipped (was: zsh 5.1.1-test-1) Daniel Shahaf
2015-11-22  1:09   ` Bart Schaefer
2015-11-25  1:44     ` Daniel Shahaf
2015-11-22  1:14   ` Bart Schaefer
2015-11-22  7:51     ` Bart Schaefer
2015-11-22 10:54 ` Sebastian Gniazdowski [this message]
2015-11-22 11:48 ` zsh 5.1.1-test-1 Manuel Presnitz
2015-11-22 12:23   ` Mikael Magnusson
2015-11-22 16:09   ` Peter Stephenson
2015-11-22 16:52     ` Peter Stephenson

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=CAKc7PVAXAPWacNWj6MsnPqttNre+cpcE12x9n60v1ygZX4QvAw@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=p.w.stephenson@ntlworld.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).