July 11th, 2005, 05:42 AM
Python and Boa on embedded system
Hi to all,
my question is a little particular..I have an embedded board (based on motorola coldfire) with installed and running uClinux with Boa and Python. I use python to write CGI program to use with Boa. I have this problem: in run-time I import che cgi module in python, but this importation is very very slow (about 7-8 secs ). The same thing doesn't happens with other modules (like Os, Time).
Somebody knows why this happens?
July 11th, 2005, 08:30 AM
I've not run embedded Python but I guess the performance issue is because the CGI mdule is a python text module (which also imports a number of modules) whereas OS and Time will be compiled C modules which are just linked in.
Does your embedded system preserve the .pyc or .pyo file?
If it does then I would hope it runs faster the second time the program is run.
What sort of storage are you using for the programs, flash?
July 11th, 2005, 09:32 AM
Thanks for the reply grim
You are right, the first time it run slower that the others, but unfortunatly this means that: first time 15sec, the others 7 secs.. I didnt tell you this before.
My system preserve the .pyc files, but I think that when the CGI program is called maybe the module is re-compiled (little faster 'cause the module was just used before). So what u think i must do?
Maybe i have to compile and link the cgi module above when compiling the entire python for the system?
My Python CGI programs are stored in Non-volatile memory, but the .pyc and .py modules are in ramdisk (i think flash then). help me!
July 11th, 2005, 09:51 AM
I don't think changing Python compile options will help - the CGI module is not going to get any closer to machine code.
I'm guessing the problem is getting the file out of storage and in to the main system program memory. Does the platform have any facilities for caching the data in system memory? I think this would be an OS option rather than a BOA or Python option.
Thats my limit on ideas
July 11th, 2005, 11:04 AM
Thanks again grim,
dont worry you help me much
I'll try tu put the module in a faster memory and i'll look for the OS option u tell me.
I'll post here if I'd find something of heplful
Thanks a lot,
PS: One last thing: the OS and the platform is without MMU, maybe it's this that makes python so slow?