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 On 2013-11-08 00:44, Alan Bell wrote: > odd, do you get something different to this? > > pi@raspberrypi ~ $ cat hello.py > print "Hello, World!" > pi@raspberrypi ~ $ time python hello.py > Hello, World! > > real 0m0.248s > user 0m0.180s > sys 0m0.050s > > > > On 07/11/13 20:06, Tyler J. Wagner wrote: >> Alan, >> >> I notice that python startup is unacceptably slow. Perhaps once the program >> is running, it's better. For instance, using python to gather data for >> snmpd is even an option, as it takes 2-3 seconds to run a simple subprocess >> call. Bash does the same almost instantly. >> >> Regards, >> Tyler > > -- "See, there's one unavoidable fact about dungeon ownership. If you leave it empty, some random monster is going to show up and start living there. I once went down the shore for the weekend, and when I got back, three manticores and an umber hulk were hanging new drapes in my living room." -- Lord Xykon, "Order of the Stick" #191 -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/