Ask an agent to make code faster and it often optimises the wrong place or quietly changes the result. You improve numerical Python performance more reliably with a fixed loop: measure, rework the most expensive part, check results against the reference, measure again. In this workshop you feed the agent profiler output and benchmarks as feedback, have loops vectorised or compiled with Numba, and learn when memory layout, data types or a better algorithm achieve more than any micro-optimisation.
Who the performance workshop is for
Developers, researchers and data teams who run compute-heavy Python scripts with NumPy and want to cut run times systematically with the help of coding agents.
What you'll walk away with
- Measure run time with cProfile, line_profiler and py-spy and pinpoint bottlenecks
- Give the agent profiler output and benchmarks as context and request targeted changes
- Vectorise loops and control memory layout, copies and data types deliberately
- Speed up computational kernels with Numba and judge the limits of that approach
- Keep a reference implementation with tolerance tests so that speed does not come at the cost of correctness
Typical scenarios
- A research group speeds up the pairwise distance calculation in a particle simulation after the profiler shows that nearly all the run time is spent in a nested Python loop.
- An engineering team shortens an overnight parameter study because the agent removes needless array copies and type conversions, and tests confirm the results are unchanged.
- After a benchmark, a data team decides not to compile an image filter with Numba but to switch to a suitable SciPy function instead.
Does this fit your team?
Pick a few dates that suit you. The request is non-binding, and the agenda is tailored in a short call beforehand.
What the performance workshop covers
- Measure firstProfilers, benchmarks and reproducible measurement conditions, and why gut feeling misleads on performance.
- The agent in the optimisation loopProfiler output as context, one change per step, then tests and a fresh measurement.
- Vectorisation and memoryBroadcasting, views instead of copies, contiguous memory and suitable data types.
- Compiling with NumbaKernels with njit, typical error messages and cases where Numba gains little.
- Algorithm before micro-optimisationComplexity, better methods and existing library routines, which are often the biggest lever.
Before the performance workshop: prerequisites
- Good Python and NumPy skills
- A script of your own with noticeable run time, or willingness to work on an example
Materials you keep
- An optimisation workflow written as instructions for coding agents
- A benchmark and test template with a reference implementation
- Your sped-up script with documented measurements