parse.zsh: Sophisticated own input on -oo

Running time: 2.8915790000
num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)  350        2884,07     8,24  100,00%   1716,24     4,90   59,51%  -hsmw-highlight-process
 2) 2800         753,47     0,27   26,12%    753,47     0,27   26,12%  -hsmw-highlight-string
 3) 2450         191,31     0,08    6,63%    131,09     0,05    4,55%  -hsmw-highlight-check-path
 4) 3850          93,37     0,02    3,24%     93,37     0,02    3,24%  -hsmw-highlight-expand-path
 5) 1400          66,66     0,05    2,31%     66,66     0,05    2,31%  (anon)
 6) 8400          54,86     0,01    1,90%     54,86     0,01    1,90%  -hsmw-highlight-is-redirection
 7) 1400          39,59     0,03    1,37%     39,59     0,03    1,37%  -hsmw-highlight-main-type
 8)  700          10,83     0,02    0,38%     10,83     0,02    0,38%  -hsmw-highlight-check-assign
This commit is contained in:
Sebastian Gniazdowski 2016-10-16 08:37:07 +02:00
parent dfba0b532b
commit ac8674bc9b

View file

@ -31,15 +31,25 @@ zmodload zsh/zprof
autoload is-at-least
# Own input?
if [[ "$1" = "-o" ]]; then
if [[ "$1" = "-o" || "$1" = "-oo" ]]; then
typeset -a input
input+=( "./parse.zsh ../hsmw-highlight parse2.out" )
input+=( "rm -f parse*.out" )
input+=( "./mh-parse.zsh ../hsmw-highlight > out" )
input+=( "if [[ -o multibyte ]]; then echo multibyte is set; fi" )
input+=( "[[ \"a\" = *[[:alpha:]_-][[:alpha:]]# ]] && echo yes" )
input+=( 'git tag -a v0.98 -m "Syntax highlighting of the history entries"' )
input+=( 'func() { echo "a" >! phist2.db; echo "b" >>! phist2.db; fc -Rap "phist2.db"; list=( ${history[@]} ); echo "${history[1]}"; }' )
if [[ "$1" = "-o" ]]; then
input+=( "./parse.zsh ../hsmw-highlight parse2.out" )
input+=( "rm -f parse*.out" )
input+=( "./mh-parse.zsh ../hsmw-highlight > out" )
input+=( "if [[ -o multibyte ]]; then echo multibyte is set; fi" )
input+=( "[[ \"a\" = *[[:alpha:]_-][[:alpha:]]# ]] && echo yes" )
input+=( 'git tag -a v0.98 -m "Syntax highlighting of the history entries"' )
input+=( 'func() { echo "a" >! phist2.db; echo "b" >>! phist2.db; fc -Rap "phist2.db"; list=( ${history[@]} ); echo "${history[1]}"; }' )
else
input+=( 'typeset -a list\n() {\necho "a" >! phist2.db\necho "b" >>! phist2.db\nfc -Rap "phist2.db"\nlist=( ${history[@]} )\necho "${history[2]}"\necho "${history[1]}"\necho "${#history}";\ninteger size="${#history}"\nsize+=1\necho "$size" / "${history[$size]}"\nlist=( "${history[$size]}" ${history[@]} )\n}' )
input+=( 'typeset -a list\n() {\necho "a" >! phist2.db\necho "b" >>! phist2.db\nfc -Rap "phist2.db"\nlist=( ${history[@]} )\necho "${history[2]}"\necho "${history[1]}"\necho "${#history}";\ninteger size="${#history}"\nsize+=1\necho "$size" / "${history[$size]}"\nlist=( "${history[$size]}" ${history[@]} )\n}' )
input+=( 'typeset -a list\n() {\necho "a" >! phist2.db\necho "b" >>! phist2.db\nfc -Rap "phist2.db"\nlist=( ${history[@]} )\necho "${history[2]}"\necho "${history[1]}"\necho "${#history}";\ninteger size="${#history}"\nsize+=1\necho "$size" / "${history[$size]}"\nlist=( "${history[$size]}" ${history[@]} )\n}' )
input+=( 'typeset -a list\n() {\necho "a" >! phist2.db\necho "b" >>! phist2.db\nfc -Rap "phist2.db"\nlist=( ${history[@]} )\necho "${history[2]}"\necho "${history[1]}"\necho "${#history}";\ninteger size="${#history}"\nsize+=1\necho "$size" / "${history[$size]}"\nlist=( "${history[$size]}" ${history[@]} )\n}' )
input+=( 'typeset -a list\n() {\necho "a" >! phist2.db\necho "b" >>! phist2.db\nfc -Rap "phist2.db"\nlist=( ${history[@]} )\necho "${history[2]}"\necho "${history[1]}"\necho "${#history}";\ninteger size="${#history}"\nsize+=1\necho "$size" / "${history[$size]}"\nlist=( "${history[$size]}" ${history[@]} )\n}' )
input+=( 'typeset -a list\n() {\necho "a" >! phist2.db\necho "b" >>! phist2.db\nfc -Rap "phist2.db"\nlist=( ${history[@]} )\necho "${history[2]}"\necho "${history[1]}"\necho "${#history}";\ninteger size="${#history}"\nsize+=1\necho "$size" / "${history[$size]}"\nlist=( "${history[$size]}" ${history[@]} )\n}' )
input+=( 'typeset -a list\n() {\necho "a" >! phist2.db\necho "b" >>! phist2.db\nfc -Rap "phist2.db"\nlist=( ${history[@]} )\necho "${history[2]}"\necho "${history[1]}"\necho "${#history}";\ninteger size="${#history}"\nsize+=1\necho "$size" / "${history[$size]}"\nlist=( "${history[$size]}" ${history[@]} )\n}' )
fi
typeset -a long_input
integer i