Ziff-Davis Enterprise 
DevSource: Microsoft Developer Resource
Add OnsArchitectureLanguagesTechniquesUsing VSForums
 
Home arrow Languages arrow Page 4 - (More Than) Five Things You Didn't Know You Could Do With Python
(More Than) Five Things You Didn't Know You Could Do With Python
By Cameron Laird

Rate This Article:
Add This Article To:
(More Than) Five Things You Didn't Know You Could Do With Python - ' High'
( Page 4 of 5 )

-Performance Python">

High-Performance Python

By some measures, Python is only about a hundredth as swift as corresponding C programs — at least for simple numeric loops and calculations. From a project standpoint, though, the interesting comparison is between the speeds of actual programs delivered in both languages.

ADVERTISEMENT

Seen that way, Python needn't apologize for its speed or the apparent lack of it. What I've observed happen many times in commercial and scientific practice is that a Python-coded application is not just adequately fast, or almost as fast, as its C or C++ counterpart, but faster.

Two factors are usually at play here. First, Python does quite well at things programmers need and use. C programmers required to handle arbitrary end-user data often write their own linked lists and associated algorithms, and end up risking that a tiny flaw in implementation will slow down operations dramatically. Python builds in associative arrays (among other datatypes). C's performance lead is fragile, in that it typically depends on quite a bit more application-specific code working as intended.

That's related to the second factor which boosts Python: Python programmers finish their work faster. Python is quite productive, according to nearly all measurements. This makes Python projects more manageable, and allows for more experimentation, redesign, and whole-system engineering. These aspects of "implementation in the large" can and do lead to algorithmic improvements of many orders of magnitude, not just the one or two that C gains with its low-level coding.

As already mentioned above, the top applications often involve a medley of languages. One of Python's early publicity successes was the supercomputing work done in the mid '90s by David Beazley, author of Python Essential Reference, and his colleagues. That team wrote fast physics simulations because of Python, not in spite of it.



 
 
>>> More Languages Articles          >>> More By Cameron Laird
 



DevSource video
Devsource Video Series
Manipulating Society through Technology
Jeremy Bailenson, Director of the Virtual Human Interaction Lab at Stanford University, talks about virtual reality, avatars, Moore's law, how real world behaviors influence online reality, and societal manipulation through technology!
>> Play video
>> Read article
>> See all videos
DevLife Blog
Julia looks at the changes to ADO.NET!
MSDev Blog
Is the latest Delphi product, RAD Studio 2007, really necessary?
Make it Work
.NET makes runtime type checking a breeze. See what Peter has to say about it in this week's tips!
News
Microsoft Counts on App Support for Vista
Microsoft has taken pains to demonstrate that Windows Vista will have ample application support.
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.