Active Topics

 


Reply
Thread Tools
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#61
Originally Posted by lostinmirkwood View Post
khertan, I'm quite interested in looking at that snippet if you wouldn't mind sharing.
edit : ok i ve write a small article on my website

http://khertan.net/article_view.php?...%20in%20python

Yes i know the code isn't really well written ... i ll refactor it later.

Last edited by Khertan; 2010-05-05 at 07:27.
 

The Following User Says Thank You to Khertan For This Useful Post:
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#62
ok, just had a quick conversation on #maemo irc after writing something in pyqt
i wanted to know how to convert the basic code to c
Code:
<lcuk> supposing i have written a simple app in python
<lcuk> it cleanly uses pyqt api and has class based structure
<lcuk> is it possible to examine the python execution model and produce a c++ representation of that code
<lcuk> for clean compilation and transfer to a regular fast c++ binary
<janneg> lcuk: there's shedskin
<lcuk> ?
<lcuk> an app?
<janneg> it probably can't handle pyqt
<lcuk> :D
<lcuk> well that can be examined
<janneg> it's an restricted python to C++ compiler
<lcuk> ive got code here that needs to be native
<lcuk> i can grep the resulting stuff and fix it
<lcuk> but i want the basic structure to come from it
<lcuk> nice, thanks for the tip jenn
<lcuk> janneg, 
<janneg> http://shed-skin.blogspot.com/
<lcuk> yeah im on there now
<lcuk> thats a really good tip :) im gonna post it on the python speedups page
<lcuk> its not a solution for everything, but if it saves the "getting started" part of converting a slow branch
<lcuk> it will be worth it
how cool is that
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 

The Following 7 Users Say Thank You to lcuk For This Useful Post:
lostinmirkwood's Avatar
Posts: 128 | Thanked: 232 times | Joined on Sep 2009 @ New Jersey, USA
#63
Originally Posted by lcuk View Post
ok, just had a quick conversation on #maemo irc after writing something in pyqt
i wanted to know how to convert the basic code to c

how cool is that

Did you have any luck with this? I tried using this myself a few weeks ago and ran into some roadblocks specifically with the PyQt modules. I'd like to hear if you had success on this front.

Edit: Seems that there's a new version 0.4 recently released!

Last edited by lostinmirkwood; 2010-05-18 at 20:42.
 
Posts: 999 | Thanked: 1,117 times | Joined on Dec 2009 @ earth?
#64
The more I tinker with Python the more I like it.

I've used many languages in my computing career and Python is so damn versatile.

Considering the resource many commercial companies put into computer languages in many respects Python puts them to shame.
__________________
I like cake.
 
Posts: 282 | Thanked: 337 times | Joined on Dec 2009 @ Austin, TX, USA
#65
Originally Posted by johnel View Post
The more I tinker with Python the more I like it.

I've used many languages in my computing career and Python is so damn versatile.

Considering the resource many commercial companies put into computer languages in many respects Python puts them to shame.
I had the exact same experience: the more I use it, the more I like it. When I have used Python for a bit and then switch back to Java, I feel like I am back in religious school where I have to dress nicely and follow a bunch of rules just to get anything done. I can pound out a python script to get stuff done, or put together a formal object-based structure--whichever I need at the time.
 
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#66
I've tried to collect the information gathered in this thread into a wikipage. Feel free to fill in what I missed

http://wiki.maemo.org/Performance_Co...or_Python_Apps
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog
 

The Following 5 Users Say Thank You to epage For This Useful Post:
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#67
Originally Posted by epage View Post
I've tried to collect the information gathered in this thread into a wikipage. Feel free to fill in what I missed

http://wiki.maemo.org/Performance_Co...or_Python_Apps
Bravo!
what an excellent writeup.
I will update the first post with this information
thanks for taking the time, I had tried but couldn't make it look like a real wiki page.



Originally Posted by lostinmirkwood View Post
Did you have any luck with this? I tried using this myself a few weeks ago and ran into some roadblocks specifically with the PyQt modules. I'd like to hear if you had success on this front.

Edit: Seems that there's a new version 0.4 recently released!
I had to do something drastic to get it building.
as you said, it does not support the pyqt class definitions so what I did for my little test app was encapsulate everything I was using qt for and made a dummy class to satisfy shedskin

http://pastebin.com/vuKMx9zc

it needed some changes and obviously is impractical once more of the qt library is used.
however it managed to throw out some fairly clean looking code.
I didn't compile it yet though because it wouldn't actually tie with real qt and setting up the Makefile for it is a bit too much faff.

its a worthwhile path to investigate further anyway
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 

The Following User Says Thank You to lcuk For This Useful Post:
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#68
Well, if I knew about Shedskin earlier, I would have recommended doing some Qt-friendlification as part of a GSoC project... Oh well, there's always next year.
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#69
attilla77,
you don't have to wait for next year to at least start to outline and flesh out the idea?

what it does take really though is someone familiar enough with shedskin to know exactly whats needed to allow it to be used properly.
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 
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.
 
Reply

Tags
performance, python


 
Forum Jump


All times are GMT. The time now is 07:28.