flutter_ecommerce_app icon indicating copy to clipboard operation
flutter_ecommerce_app copied to clipboard

Performance compared to z.sh

Open barlik opened this issue 4 years ago • 2 comments

I've been evaluating z.lua and so far I couldn't replicate 3x performance improvement claim compared to z.sh.

3x times faster than z.sh

~ ➤ time bash -ic 'for i in {1..1000}; do _zlua --add /tmp; done' &>/dev/null
bash -ic 'for i in {1..1000}; do _zlua --add /tmp; done' &> /dev/null  2.73s user 1.38s system 99% cpu 4.129 total
~ ➤ time bash -ic 'for i in {1..1000}; do _z --add /tmp; done' &>/dev/null   
bash -ic 'for i in {1..1000}; do _z --add /tmp; done' &> /dev/null  4.64s user 2.74s system 100% cpu 7.311 total

Based on my calculations on two different systems, the performance improvement is "only" 1.7x.

barlik avatar Jul 31 '19 12:07 barlik

It seems that your benchmark includes subshell processes creation time.

skywind3000 avatar Jul 31 '19 12:07 skywind3000

~ ➤ time bash -ic 'for i in {1..1000}; do let x++ ; done; echo $x'
1000

AFAIK there's no sub-shell created. If there was one then x would be 0 instead of 1000 at the end of the iteration. Anyway the iteration time without _z or _zlua is negligible.

0.12s user 0.01s system 100% cpu 0.130 total

barlik avatar Jul 31 '19 13:07 barlik