View Single Post
caco3's Avatar
Posts: 560 | Thanked: 423 times | Joined on May 2010 @ Switzerland
#70
Hi all

I am looking to speed up some very time consuming math functions used in python.
Basically I have to run a math function 1000 of time:
Code:
a=a+b*c
In python it takes several seconds to perform on my N900.

Now I had a look on ShedSkin as mentioned above.
(BTW: There got recently a new version released, 0.6)

I can generate a module on my Ubuntu PC and it works well (havent tested the speed). But how do I get it working on Maemo?
C usually has to be compile for a specific architecture, how is it on ShedSkin? How do I compile it for our ARM?

If I used the library compiled on the PC and import it in python on my N900, I get this error:
Code:
>>> from simple_module import func1, func2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: ./simple_module.so: cannot open shared object file: No such file or directory
Even I am in the correct directory:
Code:
> ls -l
-rw-r--r--    1 root     root         1023 Nov 17 06:45 Makefile
-rw-r--r--    1 root     root         2855 Nov 17 06:45 simple_module.cpp
-rw-r--r--    1 root     root          441 Nov 17 06:45 simple_module.hpp
-rw-r--r--    1 root     root          188 Nov 17 06:45 simple_module.py
-rwxr-xr-x    1 root     root      1491856 Nov 17 06:46 simple_module.so
I use the example from http://code.google.com/p/shedskin/do...orial-0.6.html

Or do you know a better way of speeding up basic python code?

Thank you for your help
__________________
On N9 check out this:
CacheMe 4 the N9, a geocaching client / MiniBible, a bible viewer / TheWord brings daily bible verses onto your phone / BatteryGraph to monitor the battery drainage / doublepress2unlock to unlock your phone with a double press onto the power button / GPRS Data Usage to monitor your GPRS data usage /
and more...

On N900 check out this: SleepAnalyser to analyse your sleep movements / PasswordMaker a for a password generator

Last edited by caco3; 2010-11-17 at 06:09.