Using python for _large_ projects like IDE

Samuel Walters swalters_usenet at yahoo.com
Sun Jan 18 10:48:38 EST 2004


| Sridhar R said |
> 1. if python is used, then the memory required for running the IDE
> will be high.
> 2. if pure python is used, the IDE will be slower.
> 
> I'm not sure whether they are true.

Well, it depends on your definition of "high memory usage."  I had no
problems running GUI python apps on my old pentium 100mhz with 74 megs of
ram.  So, unless your program should be able to run on smaller systems, I
wouldn't worry much.

 
> Then I thought of using python for 90% of the code and using C for
> other performance critical part.  But the problem is in identifying
> the performance critical code.  People suggest to start with pure
> python and then _recode_ the performance critical code after profiling
> the original code.  But I fear whether there will be a conflit in say
> data structures.  Not yet expert in extending/embedding python.
> Are there any ways to forsee the performance critical parts?

Data structures are easier to handle than you'd think when extending
python.  I recommend either boost or pyrex.  I've used pyrex, but most
people seem to use boost.

There are great python profiling tools.  It's not at all difficult to find
the performance critical portions.

As far as advice on forseeing performance critical parts, keep in mind
that there are different standards for different portions of a program. 
An IDE would have many parts where interactivity is a concern.  Noone
likes to see their keystrokes appear two seconds after they have been
typed.  Things like syntax highlighting can form a bottleneck, but I've
seen enough apps that manipulate data like this that I know it can be
done.

There are other parts, such as search-and-replace that people are a bit
more patient about.  Try to separate the two types of functionality so
that they can be recoded independently.

HTH

Sam Walters.

-- 
Never forget the halloween documents.
http://www.opensource.org/halloween/
""" Where will Microsoft try to drag you today?
    Do you really want to go there?"""




More information about the Python-list mailing list