help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: i dont see my code error there ...


From: Alex fxmbsw7 Ratchev
Subject: Re: i dont see my code error there ...
Date: Thu, 31 Mar 2022 22:24:56 +0200

here two benchmarks

t() { declare IFS=$'\n' TIMEFORMAT=%R ; time { &>/dev/null eval "$*" ; } ;
} ; printf -v skel %02000d 0 ; v1=${skel//0/: \"\"$'\n'} v2=${skel//0/:
\"\" \'\' \'\' \'\' \"\" \"\" \"\"$'\n'} ; t "$v1" ; t "$v2"

0.003
0.007

>

t() { declare IFS=$'\n' TIMEFORMAT=%R ; time { &>/dev/null eval "$*" ; } ;
} ; printf -v skel %020000d 0 ; v1=${skel//0/printf \\\\n$'\n'}
v2=${skel//0/echo$'\n'} ; t "$v1" ; t "$v2"

0.040
0.031


echo was faster =/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]