Skip to content

Commit ea7ba46

Browse files
author
Anastasiia Shcherbakova
committed
Fixed comma issues and added 'Later' specifier for one topic
1 parent d18ba1c commit ea7ba46

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

episodes/profiling-introduction.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Therefore, it is better described as a tool for **benchmarking**.
127127
Software is typically comprised of a hierarchy of function calls, both functions written by the developer and those used from the language's standard library and third party packages.
128128

129129
<!-- What -->
130-
Function-level profiling analyses where time is being spent with respect to functions. Typically function-level profiling will calculate the number of times each function is called and the total time spent executing each function, inclusive and exclusive of child function calls.
130+
Function-level profiling analyses where time is being spent with respect to functions. Typically, function-level profiling will calculate the number of times each function is called and the total time spent executing each function, inclusive and exclusive of child function calls.
131131

132132
<!-- Why -->
133133
This allows functions that occupy a disproportionate amount of the total runtime to be quickly identified and investigated.
@@ -149,7 +149,7 @@ This will identify individual lines of code that occupy an disproportionate amou
149149
<!-- Typically, function-level profiling should be attempted first as it has a greater signal-to-noise ratio and is often significantly cheaper to perform. -->
150150

151151
<!-- We will be covering -->
152-
In this course we will cover the usage of the line-level profiler `line_profiler`.
152+
Later in this course we will cover the usage of the line-level profiler `line_profiler`.
153153

154154
::::::::::::::::::::::::::::::::::::: callout
155155

@@ -159,7 +159,7 @@ Line-level profiling can be particularly expensive, a program can execute hundre
159159

160160
`line_profiler` is deterministic, meaning that it tracks every line of code executed. To avoid it being too costly, the profiling is restricted to methods targeted with the decorator `@profile`.
161161

162-
In contrast [`scalene`](https://github.com/plasma-umass/scalene) is a more advanced Python profiler capable of line-level profiling. It uses a sampling based approach, whereby the profiler halts and samples the line of code currently executing thousands of times per second. This reduces the cost of profiling, whilst still maintaining representative metrics for the most expensive components.
162+
In contrast, [`scalene`](https://github.com/plasma-umass/scalene) is a more advanced Python profiler capable of line-level profiling. It uses a sampling based approach, whereby the profiler halts and samples the line of code currently executing thousands of times per second. This reduces the cost of profiling, whilst still maintaining representative metrics for the most expensive components.
163163

164164
:::::::::::::::::::::::::::::::::::::::::::::
165165

@@ -168,7 +168,7 @@ In contrast [`scalene`](https://github.com/plasma-umass/scalene) is a more advan
168168
Timeline profiling takes a different approach to visualising where time is being spent during execution.
169169

170170
<!-- What -->
171-
Typically a subset of function-level profiling, the execution of the profiled software is instead presented as a timeline highlighting the order of function execution in addition to the time spent in each individual function call.
171+
Typically, a subset of function-level profiling, the execution of the profiled software is instead presented as a timeline highlighting the order of function execution in addition to the time spent in each individual function call.
172172

173173
<!-- Why -->
174174
By highlighting individual functions calls, patterns relating to how performance scales over time can be identified. These would be hidden with the aforementioned aggregate approaches.
@@ -205,7 +205,7 @@ Ideally, it should take no more than a few minutes to run the profiled test-case
205205

206206
<!-- For example -->
207207
<!-- I don't really like this paragraph -->
208-
For example, you may have a model which normally simulates a year in hourly timesteps.
208+
For example, you may have a model which normally simulates a year in hourly time steps.
209209
It would be appropriate to begin by profiling the simulation of a single day.
210210
If the model scales over time, such as due to population growth, it may be pertinent to profile a single day later into a simulation if the model can be resumed or configured.
211211
A larger population is likely to amplify any bottlenecks that scale with the population, making them easier to identify.
@@ -218,7 +218,7 @@ A larger population is likely to amplify any bottlenecks that scale with the pop
218218
Think about a project where you've been working with Python.
219219
Do you know where the time during execution is being spent?
220220

221-
Write a short plan of the approach you would take to investigate and confirm where the majority of time is being spent during it's execution.
221+
Write a short plan of the approach you would take to investigate and confirm where the majority of time is being spent during its execution.
222222

223223
<!-- TODO should they share this anywhere, should it be discussed within the group? -->
224224

@@ -236,7 +236,7 @@ Write a short plan of the approach you would take to investigate and confirm whe
236236
::::::::::::::::::::::::::::::::::::: keypoints
237237

238238
- Profiling is a relatively quick process to analyse where time is being spent and bottlenecks during a program's execution.
239-
- Code should be profiled when ready for deployment if it will be running for more than a few minutes during it's lifetime.
239+
- Code should be profiled when ready for deployment if it will be running for more than a few minutes during its lifetime.
240240
- There are several types of profiler each with slightly different purposes.
241241
- function-level: `cProfile` (visualised with `snakeviz`)
242242
- line-level: `line_profiler`

0 commit comments

Comments
 (0)