Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
| This chapter covers |
|---|
|
There is a standard mantra about performance when programming with Python (CPython). The mantra goes something like this: “Code in Python first; then profile and optimize your bottlenecks. Finally, if you still need your code to run faster, rewrite the performance-sensitive parts of your code in C.” Okay, as mantras go there are probably snappier ones, but it still contains a lot of wisdom. Of course, with IronPython we wouldn’t drop down to C[1] but into C# or VB.NET instead.
[1] Well, not usually. There are tools like SWIG that will allow you to generate .NET wrappers for C/C++ libraries.