Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Introduction to Python Performance | Understanding and Measuring Performance
Optimization Techniques in Python
course content

Conteúdo do Curso

Optimization Techniques in Python

Optimization Techniques in Python

1. Understanding and Measuring Performance
2. Efficient Use of Data Structures
3. Optimizing with Python's Built-in Features

bookIntroduction to Python Performance

In order to feel confident and successfully complete this course, we strongly recommend you complete the following courses beforehand (just click on them to start):

The Algorithms and Data Structures Overview course is not compulsory, however, it provides some theoretical background about algorithms and data structures.

How Python Executes Code

Python is often called an interpreted language, but it actually involves an intermediate compilation step. When you run Python code, it’s first compiled into bytecode, an intermediate form. This compilation happens automatically and is usually transparent to the user. Bytecode is stored in .pyc files to speed up future executions.

Afterward, the .pyc files are executed by the Python Virtual Machine (PVM).

While this process offers flexibility, the overhead of bytecode interpretation can make Python slower for tasks like loops, complex calculations, or large data manipulation.

However, Python's flexibility, along with its built-in functions and external libraries, allows for performance optimizations without needing to change its core execution model.

Common Performance Bottlenecks

The first step in solving any performance problem is to identify it, so let's list the most common performance bottlenecks:

Throughout this course, we will focus on specific techniques and tools to address these issues and write more efficient Python programs. Without further ado, let's dive right in!

How is Python code executed?

How is Python code executed?

Selecione a resposta correta

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 1
some-alt