Skip to content

Commit b065c43

Browse files
committed
speeding-up-v8-heap-snapshots.md: drop WPA session
1 parent 8f083a8 commit b065c43

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/blog/speeding-up-v8-heap-snapshots.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,10 @@ This also allowed us to quantify the time spent on snapshot generation with a tr
5959

6060
Furthermore, we found the problem happened on both Windows and Linux. The problem was also not platform-specific.
6161

62-
## Windows Performance Analyzer to the rescue
63-
64-
As the problem was initially reported on a Windows platform, I used [Windows Performance Toolkit](https://learn.microsoft.com/en-us/windows-hardware/test/wpt/), based on [ETW](https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-), for analysis. This is a powerful low-level expert tool to find out exactly what a program is doing on Windows.
65-
66-
To analyze the performance of heap snapshot generation, I followed [these steps](https://learn.microsoft.com/en-us/windows-hardware/test/wpt/wpr-how-to-topics#start-a-recording) to run the Windows Performance Recorder with the failing script, with `NODE_OPTIONS="--max-old-space-size=100 --heapsnapshot-near-heap-limit=10 --profile-heap-snapshot`. I had to modify Node.js to accept `--profile-heap-snapshot` in `NODE_OPTIONS`, as it uses an allowlist to filter V8 flags that can be configured through the environment variable.
67-
68-
I just let it run to generate a couple of heap snapshots (it would already take over 10 minutes!) and then I stopped the recording.
69-
7062
## First Optimization: Improved StringsStorage hashing
7163

64+
To identify what was causing the excesive delay I profiled the failing script using [Windows Performance Toolkit](https://learn.microsoft.com/en-us/windows-hardware/test/wpt/).
65+
7266
When I opened the recording with [Windows Performance Analyzer](https://learn.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer), this was what I found:
7367

7468
![](/_img/speeding-up-v8-heap-snapshots/img2.png){.no-darkening}

0 commit comments

Comments
 (0)