From the course: Python: Programming Efficiently

Unlock the full course today

Join today to access over 23,300 courses taught by industry experts.

Computer architecture and optimization techniques

Computer architecture and optimization techniques - Python Tutorial

From the course: Python: Programming Efficiently

Computer architecture and optimization techniques

- [Instructor] Python is efficient but it is not natively fast. It was built for use coding and not for performance. So if you compare Python with a Compiled Language such as FORTRAN or C, you see that Python is generally much slower for several reasons. Python is interpreted rather than compiled, which implies more overheads. It makes it hard to perform code optimizations. Python is dynamically typed, that is, the type of variables is determined at run time so Python needs to keep track of data types with larger data structures and with more checks and lookups. Other features of the language such as it's powerful and fluid object model, require that it keep and navigate the complex web of references, which again adds to the cost of every operation. And still Python is easier to use and more forgiving leading into a more efficient development cycle. Remember, your time is more precious than the CPUs. When you need to…

Contents