[ubuntu-uk] Building Ubuntu for the Raspberry Pi, on the Raspberry Pi

Tyler J. Wagner tyler at tolaris.com
Fri Nov 8 17:03:57 UTC 2013


Twice that, on a class 10 SD card:

root at raspberrypi:~# cat > hello.py
print "Hello, World!"
root at 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 at 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 at raspberrypi:~# mkdir /tmp/test
root at raspberrypi:~# mount -t tmpfs -o size=20m tmpfs /tmp/test
root at raspberrypi:~# cp hello.py /tmp/test/
root at raspberrypi:~# time python /tmp/test/hello.py
Hello, World!

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

However, bash is WAY faster:

root at raspberrypi:~# echo 'echo "Hello, World!"' > hello.sh
root at 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 at raspberrypi ~ $ cat hello.py
> print "Hello, World!"
> pi at 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



More information about the ubuntu-uk mailing list