>Unless you're wrapping existing code, do new work in Python first. >Then if you really, really must, and have no other choice. >Take a look at a 'C' extension. >Often it's not worth the head ach to code it in 'C'. An old quote, who's origin I've forgotten: "premature optimization is the root of all evil." Which is to say, profile your code first, then consider external C functions for the things which actually consume CPU time. BTW, to the original poster: the more work your code can do in C once it gets there, the better. Python carries significant overhead in dispatching to your external code. If you external function is meant to do very small amounts of work over very frequent invocations, external functions aren't as obvious a choice and the benefits aren't nearly as dramatic as you predict. Conversely, things which do very large amounts of work can push Python programs to at-or-near C speeds when done right. Calculations in Numeric Python (and friends) come to mind. C//
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4