Tagged articles
4 articles
Page 1 of 1
Code Mala Tang
Code Mala Tang
Jun 18, 2025 · Fundamentals

Master Python Performance: Using cProfile and line_profiler for Fast Code

Profiling lets you pinpoint performance bottlenecks in Python code by measuring function execution times, call counts, and line‑by‑line costs, with tools like cProfile for quick overviews and line_profiler for detailed per‑line analysis, plus tips, visualizers, and complementary utilities to optimize scripts efficiently.

ProfilingPythoncprofile
0 likes · 9 min read
Master Python Performance: Using cProfile and line_profiler for Fast Code
Python Programming Learning Circle
Python Programming Learning Circle
Feb 8, 2023 · Fundamentals

Measuring Execution Time and Memory Usage in Python

This article introduces four practical methods for monitoring Python code performance—using the built‑in time module, the %%time IPython magic, line_profiler for per‑line timing, and memory_profiler for detailed memory usage—complete with code examples and interpretation of results.

MemoryPythonline_profiler
0 likes · 7 min read
Measuring Execution Time and Memory Usage in Python