From 497001ac1ffda35626062bfc732568557a4febb2 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Wed, 6 Nov 2024 02:21:34 +0100 Subject: [PATCH] profiling exercise is now easier to follow --- content/profiling.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/profiling.md b/content/profiling.md index 3136d599..c5bcc871 100644 --- a/content/profiling.md +++ b/content/profiling.md @@ -153,9 +153,11 @@ Please try to go through the exercise in the following steps: (right-click and "save as" to download the file and **save it as "book.txt"**). 1. **Before** you run the profiler, try to predict in which function the code + (the example code is below) will spend most of the time and in which function it will use most of the memory. -1. Run the `scalene` profiler on the following code example and browse the +1. Save the example code as `example.py` and + run the `scalene` profiler on the following code example and browse the generated HTML report to find out where most of the time is spent and where most of the memory is used: ```console @@ -168,6 +170,7 @@ Please try to go through the exercise in the following steps: You can find an example of the generated HTML report in the solution below. 1. Does the result match your prediction? Can you explain the results? +Example code (`example.py`): :::{literalinclude} profiling/exercise.py :::