diff --git a/config.yaml b/config.yaml index e348cce..2b58cbd 100644 --- a/config.yaml +++ b/config.yaml @@ -60,6 +60,9 @@ contact: 'robert.chisholm@sheffield.ac.uk' # Order of episodes in your lesson episodes: - introduction.md +- profiling-introduction.md +- profiling-functions.md +- profiling-lines.md # Information for Learners learners: diff --git a/index.md b/index.md index af66276..904bbd9 100644 --- a/index.md +++ b/index.md @@ -2,8 +2,45 @@ site: sandpaper::sandpaper_site --- -This is a new lesson built with [The Carpentries Workbench][workbench]. +![Welcome to Performance Profiling & Optimisation (Python) Training! +](episodes/fig/pando-python-hex-sticker.png){ +alt='Performance Profiling & Optimisation (Python) Training' +style='padding: 2%'} +The training curriculum for this course is designed for researchers that are writing Python and lack formal training. The curriculum covers how to assess where time is being spent during execution of a Python program, it also provides a high level understanding of how code executes and how this maps to the limiting factors of performance. -[workbench]: https://carpentries.github.io/sandpaper-docs +If you are now comfortable using Python, this course may be of interest to supplement and advance your programming knowledge. This course is particularly relevant if you are writing research code and desire greater confidence that your code is both performant and suitable for publication. + + + + +## Learning Objectives + + + +After attending this training, participants will be able to: + +- identify the most expensive functions and lines of code using `cprofile` and `line_profiler`. +- evaluate code to determine the limiting factors of it's performance. +- recognise and implement optimisations for common limiting factors of performance. + +:::::::::::::::::::::::::::::::::::::::::: prereq + +## Prerequisites + +Before joining Performance Profiling & Optimisation (Python) Training, participants should be able to: + +- implement basic algorithms in Python +- follow the control flow of Python code, and dry run the execution in their head or on paper. + +See the [Research Computing Training Hub](https://sites.google.com/sheffield.ac.uk/research-training/research-training) for other courses to help with learning these skills. + + +:::::::::::::::::::::::::::::::::::::::::::::::::: diff --git a/md5sum.txt b/md5sum.txt index e48b633..aa27159 100644 --- a/md5sum.txt +++ b/md5sum.txt @@ -1,11 +1,14 @@ "file" "checksum" "built" "date" "CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2023-12-07" "LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2023-12-07" -"config.yaml" "509085b79e6ec689b015216d87ddbeff" "site/built/config.yaml" "2023-12-08" -"index.md" "a02c9c785ed98ddd84fe3d34ddb12fcd" "site/built/index.md" "2023-12-08" +"config.yaml" "9086af5e5e979722dcad1ab925ec6412" "site/built/config.yaml" "2023-12-14" +"index.md" "df8ef5258ba527e8fc3ca82f97fa27d8" "site/built/index.md" "2023-12-14" "links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2023-12-07" "episodes/introduction.md" "6c55d31b41d322729fb3276f8d4371fc" "site/built/introduction.md" "2023-12-07" +"episodes/profiling-introduction.md" "3c910052e7ff8e49edec82e5aa772f68" "site/built/profiling-introduction.md" "2023-12-14" +"episodes/profiling-functions.md" "6e3d4d42db22b5ea2d9a112c61940289" "site/built/profiling-functions.md" "2023-12-14" +"episodes/profiling-lines.md" "f21cb8b587a238657ac5bdf28df59e50" "site/built/profiling-lines.md" "2023-12-14" "instructors/instructor-notes.md" "cae72b6712578d74a49fea7513099f8c" "site/built/instructor-notes.md" "2023-12-07" "learners/reference.md" "1c7cc4e229304d9806a13f69ca1b8ba4" "site/built/reference.md" "2023-12-07" -"learners/setup.md" "61568b36c8b96363218c9736f6aee03a" "site/built/setup.md" "2023-12-07" +"learners/setup.md" "eda96a4aa0e52fe92f91868fb2ecd5c0" "site/built/setup.md" "2023-12-14" "profiles/learner-profiles.md" "60b93493cf1da06dfd63255d73854461" "site/built/learner-profiles.md" "2023-12-07" diff --git a/profiling-functions.md b/profiling-functions.md new file mode 100644 index 0000000..d1d629b --- /dev/null +++ b/profiling-functions.md @@ -0,0 +1,17 @@ +--- +title: "Function Level Profiling" +teaching: 0 +exercises: 0 +--- + +:::::::::::::::::::::::::::::::::::::: questions + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: + +::::::::::::::::::::::::::::::::::::: objectives + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: \ No newline at end of file diff --git a/profiling-introduction.md b/profiling-introduction.md new file mode 100644 index 0000000..3efe56b --- /dev/null +++ b/profiling-introduction.md @@ -0,0 +1,19 @@ +--- +title: "Introduction to Profiling" +teaching: 0 +exercises: 0 +--- + +:::::::::::::::::::::::::::::::::::::: questions + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: + +::::::::::::::::::::::::::::::::::::: objectives + +- explain the benefits of profiling code and different types of profiler +- identify the appropriate Python profiler for a given scenario +- explain how to select an appropriate test case for profiling and why + +:::::::::::::::::::::::::::::::::::::::::::::::: \ No newline at end of file diff --git a/profiling-lines.md b/profiling-lines.md new file mode 100644 index 0000000..08686bb --- /dev/null +++ b/profiling-lines.md @@ -0,0 +1,17 @@ +--- +title: "Line Level Profiling" +teaching: 0 +exercises: 0 +--- + +:::::::::::::::::::::::::::::::::::::: questions + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: + +::::::::::::::::::::::::::::::::::::: objectives + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: \ No newline at end of file diff --git a/setup.md b/setup.md index 46eddd1..d2f151d 100644 --- a/setup.md +++ b/setup.md @@ -2,17 +2,15 @@ title: Setup --- -FIXME: Setup instructions live in this document. Please specify the tools and -the data sets the Learner needs to have installed. - + + Download the [data zip file](https://example.com/FIXME) and unzip it to your Desktop +--> ## Software Setup @@ -20,35 +18,14 @@ Download the [data zip file](https://example.com/FIXME) and unzip it to your Des ### Details -Setup for different systems can be presented in dropdown menus via a `solution` -tag. They will join to this discussion block, so you can give a general overview -of the software used in this lesson here and fill out the individual operating -systems (and potentially add more, e.g. online setup) in the solutions blocks. - -::::::::::::::::::::::::::::::::::::::::::::::::::: - -:::::::::::::::: solution - -### Windows - -Use PuTTY +This course uses Python and was developed using Python 3.11, therefore it is recommended that you have a Python 3.11 or newer environment. -::::::::::::::::::::::::: + -:::::::::::::::: solution - -### MacOS - -Use Terminal.app - -::::::::::::::::::::::::: - - -:::::::::::::::: solution - -### Linux - -Use Terminal - -::::::::::::::::::::::::: +The non-core Python packages required by the course are `snakeviz` and `line_profiler` and can be installed via `pip`. + +```input +pip install snakeviz line_profiler[all] +``` +:::::::::::::::::::::::::::::::::::::::::::::::::::