#!/usr/local/bin/zsh-arr-assign
#!/usr/local/bin/zsh-arr-assign-before

zmodload zsh/zprof

typeset -a arr

test_fun() {
    arr[20000]=""
    repeat 10000; do
        arr[10000]="x"
    done
}

test_fun

print -rl $arr[@] $arr[10000]

zprof
