Skip to content

Commit cd7af70

Browse files
committed
fix: correct typos in README for improved clarity and consistency
1 parent 9ffe5c1 commit cd7af70

File tree

1 file changed

+7
-7
lines changed
  • exercises/04.performance/01.solution.profiling-slow-tests

1 file changed

+7
-7
lines changed

exercises/04.performance/01.solution.profiling-slow-tests/README.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ This information is available each time you run your tests and is not exclusive
6161
- `environment`, the time it took to set up and tear down your test environment;
6262
- `prepare`, the time it took for Vitest to prepare the test runner.
6363

64-
This overview is a fantastic starting point in indentifying which areas of your test run are the slowest. For instance, I can see that Vitest spent most time _running the tests_:
64+
This overview is a fantastic starting point in identifying which areas of your test run are the slowest. For instance, I can see that Vitest spent most time _running the tests_:
6565

6666
```txt nonumber highlight=4
6767
transform 18ms,
@@ -72,7 +72,7 @@ environment 0ms,
7272
prepare 32ms
7373
```
7474

75-
> Your test duration summary will likely be different. See which phases took the most time to know where you should direct your further investigation. For example, if the `setup` phase is too slow, it may be because your test setup is too heavy and should be refactored. If `collect` is lagging behind, it may mean that Vitest has trouble scrapping your large monorepo and you should help it locate the test files by providing explicit `include` and `exclude` options in your Vitest configuration.
75+
> Your test duration summary will likely be different. See which phases took the most time to know where you should direct your further investigation. For example, if the `setup` phase is too slow, it may be because your test setup is too heavy and should be refactored. If `collect` is lagging behind, it may mean that Vitest has trouble scraping your large monorepo and you should help it locate the test files by providing explicit `include` and `exclude` options in your Vitest configuration.
7676
7777
With this covered, let's move on to the `vitest-profiler` report.
7878

@@ -83,18 +83,18 @@ With this covered, let's move on to the `vitest-profiler` report.
8383
- **Main thread**, which is a Node.js process that spawned Vitest. This roughly corresponds to the `prepare`, `collect`, `transform`, and `environment` phases from the Vitest's time metrics;
8484
- **Tests**, which is individual threads/forks that ran your test files. This roughly corresponds to the `tests` time metric.
8585

86-
These separate profiles allows you to take a peek behind the curtain of your test runtime. You can get an idea of what your testing framework is doing and what your tests are doing, and, hopefully, spot the root cause for that nasty parformance degradation.
86+
These separate profiles allow you to take a peek behind the curtain of your test runtime. You can get an idea of what your testing framework is doing and what your tests are doing, and, hopefully, spot the root cause for that nasty performance degradation.
8787

8888
CPU and memory profiles reflect different aspects of your test run:
8989

9090
- **CPU profile** shows you the CPU consumption. This will generally point you toward code that takes too much time to run;
91-
- **Memory (or heap) profile** shows you the memory consumption. This is handy to watch for memory leaks and heaps that can also negavtively impact your test performance.
91+
- **Memory (or heap) profile** shows you the memory consumption. This is handy to watch for memory leaks and heaps that can also negatively impact your test performance.
9292

9393
Next, I will explore each individual profile in more detail.
9494

9595
### Main thread profiles
9696

97-
One of the firts things the profiler reports is a CPU profile for the main thread:
97+
One of the first things the profiler reports is a CPU profile for the main thread:
9898

9999
```txt nonumber highlight=4
100100
Test profiling complete! Generated the following profiles:
@@ -115,7 +115,7 @@ Here's how the CPU profile for the main thread looks like:
115115

116116
> Now, if this looks intimidating, don't worry. Profiles will often contain a big chunk of pointers and stack traces you don't know or understand because they reflect the state of the _entire process_.
117117
118-
In these profiles, I am interested in spotting _abnormally long execution times_. Luckily, this report is sortred by "Total Time" automatically for me! That being said, I see nothing suspicious in the main thread so I proceed to the other profiles.
118+
In these profiles, I am interested in spotting _abnormally long execution times_. Luckily, this report is sorted by "Total Time" automatically for me! That being said, I see nothing suspicious in the main thread so I proceed to the other profiles.
119119

120120
### Test profiles
121121

@@ -144,5 +144,5 @@ What I can also do is give you a rough idea about approaching issues based on th
144144
| CPU | Memory |
145145
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
146146
| Analyze your expensive logic and refactor it where appropriate. | Analyze the problematic logic to see why it leaks memory. |
147-
| Take advantage of asynchronicity and parallelization. | Fix improper memory management (e.g. rougue child processes, unterminated loops, forgotten timers and intervals, etc). |
147+
| Take advantage of asynchronicity and parallelization. | Fix improper memory management (e.g. rogue child processes, unterminated loops, forgotten timers and intervals, etc). |
148148
| Use caching where appropriate. | In your test setup, be cautious about closing test servers or databases. Prefer scoping mocks to individual tests and deleting them completely once the test is done. |

0 commit comments

Comments
 (0)