yeah, I was using a slightly fancy SLC SD card. I would expect bash to be faster, it has way less to do, however 0.4 seconds is not 2-3 seconds.

Alan.

On 08/11/13 17:03, Tyler J. Wagner wrote:
Twice that, on a class 10 SD card:

root@raspberrypi:~# cat > hello.py
print "Hello, World!"
root@raspberrypi:~# time python hello.py
Hello, World!

real    0m0.443s
user    0m0.140s
sys     0m0.090s

But it could just be a slow filesystem. Running it repeatedly, it's faster:

root@raspberrypi:~# time python /root/hello.py
Hello, World!

real    0m0.223s
user    0m0.180s
sys     0m0.010s

And using a tmpfs is equally fast:

root@raspberrypi:~# mkdir /tmp/test
root@raspberrypi:~# mount -t tmpfs -o size=20m tmpfs /tmp/test
root@raspberrypi:~# cp hello.py /tmp/test/
root@raspberrypi:~# time python /tmp/test/hello.py
Hello, World!

real    0m0.205s
user    0m0.180s
sys     0m0.020s

However, bash is WAY faster:

root@raspberrypi:~# echo 'echo "Hello, World!"' > hello.sh
root@raspberrypi:~# time bash hello.sh
Hello, World!

real    0m0.021s
user    0m0.000s
sys     0m0.010s

Regards,
Tyler

--
I work at http://libertus.co.uk


--
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/

Reply via email to