Peng Yu
2018-01-21 19:10:31 UTC
Hi,
I tried `declare -i`. But it doesn't see to improve performance. Is it
supposed to improve the performance? Thanks.
$ time ./script2.sh; time ./script.sh
real 0m6.764s
user 0m6.733s
sys 0m0.015s
real 0m6.810s
user 0m6.782s
sys 0m0.010s
==> script.sh <==
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:
declare -i i
for ((i=0;i<1000000;++i))
do
:
done
==> script2.sh <==
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:
for ((i=0;i<1000000;++i))
do
:
done
I tried `declare -i`. But it doesn't see to improve performance. Is it
supposed to improve the performance? Thanks.
$ time ./script2.sh; time ./script.sh
real 0m6.764s
user 0m6.733s
sys 0m0.015s
real 0m6.810s
user 0m6.782s
sys 0m0.010s
==> script.sh <==
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:
declare -i i
for ((i=0;i<1000000;++i))
do
:
done
==> script2.sh <==
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:
for ((i=0;i<1000000;++i))
do
:
done
--
Regards,
Peng
Regards,
Peng