p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Open Source > Python
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Python section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 8th, 2007, 08:13 AM
Authorized User
Points: 29, Level: 1
Points: 29, Level: 1 Points: 29, Level: 1 Points: 29, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2005
Location: Zagreb, , Croatia.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Python code optimization

Need some hints in speeding up the Python scripts!!!

(1)Except partial objects module importing, i need to find out how to
improve performance in spatial and time consumption!
example[u]</u>:
%instead of importing a whole gzip module
import gzip
%I use partial import of methods I am going to use, from the gzip module
import compress from gzip
import decompress from gzip

The example is rudimentary, but it explains the problem in hand. Because even the simplest gui aplication extracts 8MB of memory space, and that is absolutely to much...
Please, if any hints come across your mind, feel free to post your code...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old January 9th, 2009, 04:03 PM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2009
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default The other way around

I'm not sure I understand the question, but I think it's a syntax error.
You are meant to do: from MODULE import something
for example: from gzip import compress
you can also use import gzip.compress

You say that you want to optimise your code by avoiding the import of redundant modules, that's great, I'm not sure how much optimisation you'll get (it depends on how much redundancies you had before) but it sure can't heart. if you want to do some more hardcore optimisation checkout psyco.sourceforge.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Python? elvisfeverr Python 1 January 9th, 2009 03:46 PM
python arafat.eajaz Other Programming Languages 0 July 18th, 2008 04:16 AM
RSS Code for python 2.5 (pyxml Vs 4Suite) dsampson BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 1 February 12th, 2008 10:49 AM
Is Python Clear? Static BOOK: Beginning Python 1 November 2nd, 2007 10:31 AM
Basic Python Installation musicguy BOOK: Beginning Python 0 September 14th, 2006 12:15 AM



All times are GMT -4. The time now is 03:07 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc