Tutor: Dr Chris Cooling
Course Level: Level 2
Prerequisites:  This course is aimed at Python users who have been using Python intensively for three months or more and would like to improve their skills. Less experienced users may struggle to keep up and students who have used Python for many years may already be familiar with most of the concepts presented. Knowledge of maths (A-level standard) would be beneficial but is not required.
Course Duration: 2 x 2hour sessions
Format: Microsoft Teams with live teaching and hands-on practice

Codes produced for research purposes will sometimes be expected to perform complex or extensive tasks which can require a lot of time to run. Profiling a piece of code allows us to identify why a code takes a long time to run and optimisation allows us to reduce this running time. 

This course discusses the role of profiling and optimisation in the software development cycle and encourages students to consider when and where profiling and optimisation are appropriate for a project. Profiling tools relating to both run-time and memory are introduced, and various optimisation strategies are demonstrated. The course will conclude with asking students to profile and optimise a piece of sample code.


  • What are profiling and optimisation?
  • What are the costs and benefits of profiling and optimisation?
  • When are profiling and optimisation justified in the software development cycle?
  • Profiling tools available in Python
  • Optimisation strategies in Python

The course will be delivered through a combination of slides, discussions, demonstrations and hands on practicals.

Learning Outcomes:

After completing this workshop, you will be better able to:

  • Determine when profiling and optimisation is appropriate for a project
  • Use selected profilers to examine the impact of sections of code on run-time and the memory usage
  • Utilise profiler outputs to identify problematic areas of code
  • Apply common optimisation techniques to improve code performance 

Pre-Course setup


Tuesday 25 May 2021, 10:00-12:00 (Part One)
Wednesday 26 May 2021, 10:00-12:00 (Part Two)
Microsoft Teams


Summary of the table's contents

Students must attend both parts to be awarded the course credit