profiler-md 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/cli/index.mjs +2787 -1669
  2. package/dist/index.d.mts +249 -78
  3. package/dist/index.js +2 -2
  4. package/docs/formats/collapsed.md +12 -0
  5. package/docs/formats/jsc-heap-snapshot.md +13 -0
  6. package/docs/formats/webkit-timeline-recording.md +9 -0
  7. package/docs/languages/c.md +1 -1
  8. package/docs/languages/cpp.md +136 -0
  9. package/docs/languages/csharp.md +49 -0
  10. package/docs/languages/elixir.md +42 -0
  11. package/docs/languages/erlang.md +42 -0
  12. package/docs/languages/fsharp.md +49 -0
  13. package/docs/languages/go.md +2 -2
  14. package/docs/languages/java.md +10 -7
  15. package/docs/languages/javascript.md +69 -0
  16. package/docs/languages/julia.md +42 -0
  17. package/docs/languages/kotlin.md +120 -0
  18. package/docs/languages/python.md +10 -4
  19. package/docs/languages/typescript.md +254 -0
  20. package/examples/bun.cpuprofile.md +94 -116
  21. package/examples/deno.cpuprofile.md +11 -18
  22. package/examples/jsc-heap-snapshot.base.json.md +507 -0
  23. package/examples/jsc-heap-snapshot.current.json.md +504 -0
  24. package/examples/jsc-heap-snapshot.diff.json.md +119 -0
  25. package/examples/node.base.cpuprofile.md +451 -0
  26. package/examples/node.current.cpuprofile.md +449 -0
  27. package/examples/node.diff.cpuprofile.md +82 -0
  28. package/examples/node.heapprofile.md +178 -223
  29. package/examples/node.heapsnapshot.md +268 -266
  30. package/examples/node.pprof.md +36 -45
  31. package/examples/python.base.collapsed.md +116 -0
  32. package/examples/python.current.collapsed.md +125 -0
  33. package/examples/python.diff.collapsed.md +51 -0
  34. package/examples/{rust1.pprof.md → rust.base.pprof.md} +223 -226
  35. package/examples/{rust2.pprof.md → rust.current.pprof.md} +199 -199
  36. package/examples/rust.diff.pprof.md +117 -0
  37. package/examples/webkit-timeline-recording.json.md +434 -0
  38. package/package.json +30 -18
  39. package/readme.md +173 -85
  40. package/examples/node.cpuprofile.md +0 -499
  41. package/examples/node.speedscope.json.md +0 -416
@@ -0,0 +1,254 @@
1
+ # JavaScript
2
+
3
+ Profiling JavaScript works across Node.js, Deno, Bun, and Chrome via V8 CPU
4
+ profiles, V8 heap profiles, and V8 heap snapshots.
5
+
6
+ ## CPU profiling
7
+
8
+ Periodically samples the call stack. Useful for finding CPU hot spots.
9
+
10
+ ### CLI
11
+
12
+ ```sh
13
+ # Node.js
14
+ node --cpu-prof script.js
15
+
16
+ # Deno
17
+ deno run --cpu-prof script.ts
18
+
19
+ # Bun (output was incorrect before v1.3.13)
20
+ bun --cpu-prof script.ts
21
+ ```
22
+
23
+ #### Flags
24
+
25
+ | Flag | Default | Description |
26
+ | -------------------------- | ---------------------------------- | --------------------------------------------- |
27
+ | `--cpu-prof` | — | Write a CPU profile on exit; enabled when set |
28
+ | `--cpu-prof-interval=<µs>` | `1000` | Sampling interval in microseconds |
29
+ | `--cpu-prof-dir=<dir>` | `.` | Directory to write the profile to |
30
+ | `--cpu-prof-name=<name>` | `CPU.<timestamp>.<pid>.cpuprofile` | Filename for the profile |
31
+
32
+ ### Programmatic API
33
+
34
+ Profile a specific section of code rather than the whole process:
35
+
36
+ ```js
37
+ import { writeFileSync } from 'node:fs'
38
+ import { Session } from 'node:inspector/promises'
39
+
40
+ const session = new Session()
41
+ session.connect()
42
+ await session.post(`Profiler.enable`)
43
+ await session.post(`Profiler.setSamplingInterval`, { interval: 100 })
44
+ await session.post(`Profiler.start`)
45
+
46
+ // Code to profile...
47
+
48
+ const { profile } = await session.post(`Profiler.stop`)
49
+ writeFileSync(`cpu.cpuprofile`, JSON.stringify(profile))
50
+ ```
51
+
52
+ ## Memory profiling
53
+
54
+ Samples heap allocations by stack trace. Useful for finding allocation hot spots
55
+ and reducing GC pressure.
56
+
57
+ `bun --heap-prof` generates a heap _snapshot_ on exit, not a heap _profile_.
58
+ Deno has no equivalent.
59
+
60
+ ### CLI
61
+
62
+ ```sh
63
+ # Node.js
64
+ node --heap-prof script.js
65
+ ```
66
+
67
+ #### Flags
68
+
69
+ | Flag | Default | Description |
70
+ | ------------------------------ | -------- | ---------------------------------------------- |
71
+ | `--heap-prof` | — | Write a heap profile on exit; enabled when set |
72
+ | `--heap-prof-interval=<bytes>` | `524288` | Sampling interval in bytes (default 512 KB) |
73
+ | `--heap-prof-dir=<dir>` | `.` | Directory to write the profile to |
74
+ | `--heap-prof-name=<name>` | — | Filename for the profile |
75
+
76
+ ### Programmatic API
77
+
78
+ ```js
79
+ import { writeFileSync } from 'node:fs'
80
+ import { Session } from 'node:inspector/promises'
81
+
82
+ const session = new Session()
83
+ session.connect()
84
+ await session.post(`HeapProfiler.enable`)
85
+ await session.post(`HeapProfiler.startSamplingHeapProfiler`, {
86
+ samplingInterval: 524_288,
87
+ })
88
+
89
+ // Code to profile...
90
+
91
+ const { profile } = await session.post(`HeapProfiler.stopSamplingHeapProfiler`)
92
+ writeFileSync(`heap.heapprofile`, JSON.stringify(profile))
93
+ ```
94
+
95
+ ## Heap snapshots
96
+
97
+ Captures a snapshot of all live objects on the heap. Useful for diagnosing
98
+ memory leaks.
99
+
100
+ ### CLI
101
+
102
+ ```sh
103
+ # Trigger on OOM
104
+ node --heapsnapshot-near-heap-limit=1 script.js
105
+
106
+ # Trigger on signal
107
+ node --heapsnapshot-signal=USR2 script.js # then: kill -USR2 <pid>
108
+
109
+ # Bun (on exit)
110
+ bun --heap-prof script.ts
111
+ ```
112
+
113
+ #### Node.js flags
114
+
115
+ | Flag | Default | Description |
116
+ | ------------------------------------ | ------- | ---------------------------------------------------------- |
117
+ | `--heapsnapshot-near-heap-limit=<n>` | — | Write up to n snapshots when the heap approaches its limit |
118
+ | `--heapsnapshot-signal=<signal>` | — | Signal that triggers a snapshot on demand (e.g. `USR2`) |
119
+
120
+ #### Bun flags
121
+
122
+ | Flag | Default | Description |
123
+ | ------------------------- | ------- | ----------------------------------------------- |
124
+ | `--heap-prof` | — | Write a heap snapshot on exit; enabled when set |
125
+ | `--heap-prof-dir=<dir>` | `.` | Directory to write the snapshot to |
126
+ | `--heap-prof-name=<name>` | — | Filename for the snapshot |
127
+
128
+ ### Programmatic API
129
+
130
+ ```js
131
+ import { writeHeapSnapshot } from 'node:v8'
132
+
133
+ // Code to capture...
134
+ writeHeapSnapshot(`heap.heapsnapshot`)
135
+ ```
136
+
137
+ ## pprof
138
+
139
+ Node.js can also emit [pprof](https://github.com/google/pprof) profiles via the
140
+ [`@datadog/pprof`](https://www.npmjs.com/package/@datadog/pprof) package, which
141
+ profiles a section of code rather than the whole process.
142
+
143
+ ### CPU profiling
144
+
145
+ Samples wall-clock time across all threads. Useful for finding CPU hot spots and
146
+ time spent waiting.
147
+
148
+ ```js
149
+ import { writeFile } from 'node:fs/promises'
150
+ import { encode, time } from '@datadog/pprof'
151
+
152
+ const profile = await time.profile({ durationMillis: 10_000 })
153
+ await writeFile(`cpu.pb.gz`, await encode(profile))
154
+ ```
155
+
156
+ ### Memory profiling
157
+
158
+ Samples heap allocations by stack trace. Useful for finding allocation hot spots
159
+ and reducing GC pressure.
160
+
161
+ ```js
162
+ import { writeFile } from 'node:fs/promises'
163
+ import { encode, heap } from '@datadog/pprof'
164
+
165
+ heap.start(512 * 1024, 64) // Sampling interval in bytes, max stack depth
166
+
167
+ // Code to profile...
168
+
169
+ await writeFile(`heap.pb.gz`, await encode(await heap.profile()))
170
+ ```
171
+
172
+ ## Chrome DevTools
173
+
174
+ Chrome DevTools can profile JavaScript running in the browser or connected to
175
+ Node.js, Deno, or Bun via `--inspect`. The panels and workflow are the same in
176
+ both cases.
177
+
178
+ ### Connecting
179
+
180
+ **In the browser:** open DevTools with ⌥⌘I (macOS) or Ctrl+Shift+I
181
+ (Windows/Linux).
182
+
183
+ **Via `--inspect` (Node.js, Deno, Bun):** start the process with the inspector
184
+ enabled, then open `chrome://inspect` in Chrome and click **Open dedicated
185
+ DevTools for Node**. For Bun, open the URL printed to stderr in
186
+ [debug.bun.sh](https://debug.bun.sh) — Bun uses the WebKit Inspector Protocol
187
+ rather than V8's.
188
+
189
+ ```sh
190
+ # Node.js (default port 9229)
191
+ node --inspect script.js
192
+
193
+ # Deno (default port 9229)
194
+ deno run --inspect script.ts
195
+
196
+ # Bun (auto-assigned port)
197
+ bun --inspect script.ts
198
+ ```
199
+
200
+ #### Flags (all runtimes)
201
+
202
+ | Flag | Description |
203
+ | ------------------------------ | ----------------------------------------------------------- |
204
+ | `--inspect[=<host:port>]` | Start the inspector; code runs immediately |
205
+ | `--inspect-wait[=<host:port>]` | Wait for a debugger to attach before running |
206
+ | `--inspect-brk[=<host:port>]` | Wait for a debugger to attach, then break on the first line |
207
+
208
+ ### CPU profiling
209
+
210
+ Open the **Performance** panel and click **Record**. Stop recording when done.
211
+
212
+ ### Heap allocation profiling
213
+
214
+ Open the **Memory** panel, select **Allocation sampling**, and click **Start**.
215
+ Stop when done to see allocation hot spots by call stack.
216
+
217
+ ### Heap snapshots
218
+
219
+ Open the **Memory** panel, select **Heap snapshot**, and click **Take
220
+ snapshot**.
221
+
222
+ ## Safari Web Inspector
223
+
224
+ Safari's Web Inspector records a timeline that combines CPU sampling, browser
225
+ activity, and optionally memory readings and heap allocations, all exported as a
226
+ single file.
227
+
228
+ ### Connecting
229
+
230
+ Open the Web Inspector with **Develop → Show Web Inspector** (or ⌥⌘I).
231
+
232
+ ### Recording
233
+
234
+ 1. Click the **Timelines** tab.
235
+ 2. Enable the instruments you want: **JavaScript & Events** (always), and
236
+ optionally **Memory** and **JavaScript Allocations**.
237
+ 3. Click **Start Recording** (or ⌘R).
238
+ 4. Reproduce the scenario you want to profile.
239
+ 5. Click **Stop Recording**.
240
+ 6. Click the **Export** button (arrow icon) and save as a `.json` file.
241
+
242
+ ### Heap snapshots
243
+
244
+ Open the **Memory** panel, select **Heap Snapshot**, and click **Take
245
+ Snapshot**.
246
+
247
+ #### Programmatic API
248
+
249
+ `console.takeHeapSnapshot()` is a non-standard WebKit extension that takes a
250
+ heap snapshot from JavaScript and adds it to the **Memory** panel:
251
+
252
+ ```js
253
+ console.takeHeapSnapshot()
254
+ ```
@@ -5,7 +5,7 @@ Took 2.44s over 15,182 samples (161.2µs per sample).
5
5
  | Category | % | Time | Samples |
6
6
  | ----------- | ----: | ------: | ------: |
7
7
  | ours | 73.0% | 1.78s | 11,143 |
8
- | native | 23.6% | 578.7ms | 3,551 |
8
+ | stdlib | 23.6% | 578.7ms | 3,551 |
9
9
  | third-party | 3.0% | 72.7ms | 425 |
10
10
  | module | 0.4% | 10.1ms | 62 |
11
11
  | unknown | 0.0% | 0.2ms | 1 |
@@ -19,25 +19,25 @@ Functions ranked by time spent directly in the function body, excluding callees.
19
19
  | % | Time | Samples | Function | Location |
20
20
  | ----: | ------: | ------: | ------------------------------------------- | --------------------------------------- |
21
21
  | 28.7% | 701.2ms | 4,402 | `unevalLiteral` | uneval/src/internal/primitive.ts:139:23 |
22
- | 11.5% | 281.3ms | 1,768 | `join` | `<native>` |
22
+ | 11.5% | 281.3ms | 1,768 | `join` | `<unknown>` |
23
23
  | 10.9% | 267.6ms | 1,667 | `traverseObject` | uneval/src/index.ts:204:26 |
24
24
  | 9.5% | 232.9ms | 1,454 | `unevalNumber` | uneval/src/internal/primitive.ts:12:29 |
25
- | 7.2% | 176.8ms | 1,111 | `getOwnPropertyDescriptor` | `<native>` |
25
+ | 7.2% | 176.8ms | 1,111 | `getOwnPropertyDescriptor` | `<unknown>` |
26
26
  | 4.8% | 116.4ms | 728 | `unevalObjectLiteralKey` | uneval/src/internal/object.ts:384:32 |
27
27
  | 4.5% | 109.6ms | 691 | `getType` | uneval/src/internal/type.ts:4:24 |
28
28
  | 3.0% | 72.5ms | 451 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
29
29
  | 2.9% | 70.6ms | 435 | `traverse` | uneval/src/index.ts:164:20 |
30
30
  | 2.8% | 68.3ms | 420 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
31
- | 2.2% | 54.8ms | 341 | `/^[$_\p{ID_Start}][$_\p{ID_Continue}]*$/u` | `<native>` |
31
+ | 2.2% | 54.8ms | 341 | `/^[$_\p{ID_Start}][$_\p{ID_Continue}]*$/u` | `<unknown>` |
32
32
  | 1.4% | 33.1ms | 204 | `unevalString` | uneval/src/internal/primitive.ts:133:29 |
33
33
  | 1.3% | 32.4ms | 183 | `createState` | uneval/src/index.ts:144:21 |
34
34
  | 1.3% | 32.1ms | 200 | `uneval` | uneval/src/index.ts:75:16 |
35
35
  | 1.2% | 28.3ms | 178 | `unevalBoolean` | uneval/src/internal/primitive.ts:8:30 |
36
- | 0.5% | 13.0ms | 80 | `push` | `<native>` |
37
- | 0.4% | 11.0ms | 7 | `(anonymous)` | `<native>` |
38
- | 0.3% | 8.2ms | 46 | `map` | `<native>` |
39
- | 0.3% | 7.5ms | 38 | `parseModule` | `<native>` |
36
+ | 0.5% | 13.0ms | 80 | `push` | `<unknown>` |
37
+ | 0.3% | 8.2ms | 46 | `map` | `<unknown>` |
40
38
  | 0.3% | 7.3ms | 47 | `unevalInternal` | uneval/src/internal/index.ts:25:32 |
39
+ | 0.2% | 5.5ms | 35 | `unevalObjectInternal` | uneval/src/internal/object.ts:68:30 |
40
+ | 0.2% | 4.1ms | 26 | `unevalObjectAssign` | uneval/src/internal/collection.ts:89:28 |
41
41
 
42
42
  #### Lines
43
43
 
@@ -151,13 +151,7 @@ Lines ranked by contribution to each function's self time.
151
151
  | -----: | -----: | ------: | ----------------------------------- |
152
152
  | 100.0% | 28.3ms | 178 | uneval/src/internal/primitive.ts:10 |
153
153
 
154
- ##### `(anonymous)` (`<native>`)
155
-
156
- | % | Time | Samples | Location |
157
- | ----: | -----: | ------: | -------- |
158
- | 96.2% | 10.5ms | 4 | 11 |
159
-
160
- ##### `map` (`<native>`)
154
+ ##### `map` (`<unknown>`)
161
155
 
162
156
  | % | Time | Samples | Location |
163
157
  | -----: | ----: | ------: | -------- |
@@ -173,6 +167,19 @@ Lines ranked by contribution to each function's self time.
173
167
  | 2.2% | 0.2ms | 1 | uneval/src/internal/index.ts:54 |
174
168
  | 2.1% | 0.2ms | 1 | uneval/src/internal/index.ts:44 |
175
169
 
170
+ ##### `unevalObjectInternal` (uneval/src/internal/object.ts:68:30)
171
+
172
+ | % | Time | Samples | Location |
173
+ | ----: | ----: | ------: | -------------------------------- |
174
+ | 82.9% | 4.5ms | 29 | uneval/src/internal/object.ts:69 |
175
+ | 17.1% | 0.9ms | 6 | uneval/src/internal/object.ts:78 |
176
+
177
+ ##### `unevalObjectAssign` (uneval/src/internal/collection.ts:89:28)
178
+
179
+ | % | Time | Samples | Location |
180
+ | -----: | ----: | ------: | ------------------------------------ |
181
+ | 100.0% | 4.1ms | 26 | uneval/src/internal/collection.ts:89 |
182
+
176
183
  #### Callers
177
184
 
178
185
  Callers ranked by contribution to each function's self time. Caller attribution may be imprecise due to inlining.
@@ -183,13 +190,12 @@ Callers ranked by contribution to each function's self time. Caller attribution
183
190
  | -----: | ------: | ------: | -------------- | --------------------------------------- |
184
191
  | 100.0% | 701.2ms | 4,402 | `unevalString` | uneval/src/internal/primitive.ts:133:29 |
185
192
 
186
- ##### `join` (`<native>`)
193
+ ##### `join` (`<unknown>`)
187
194
 
188
- | % | Time | Samples | Caller | Location |
189
- | ----: | ------: | ------: | ------------------------- | ------------------------------------------------------------------------------------------- |
190
- | 61.8% | 173.9ms | 1,091 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
191
- | 37.6% | 105.9ms | 668 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
192
- | 0.5% | 1.5ms | 9 | `mapperWithCloneIfNeeded` | uneval/node_modules/.pnpm/fast-check@4.6.0/node_modules/fast-check/lib/fast-check.js:468:25 |
195
+ | % | Time | Samples | Caller | Location |
196
+ | ----: | ------: | ------: | ------------------ | -------------------------------------- |
197
+ | 61.8% | 173.9ms | 1,091 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
198
+ | 37.6% | 105.9ms | 668 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
193
199
 
194
200
  ##### `traverseObject` (uneval/src/index.ts:204:26)
195
201
 
@@ -206,7 +212,7 @@ Callers ranked by contribution to each function's self time. Caller attribution
206
212
  | 0.6% | 1.3ms | 8 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
207
213
  | 0.1% | 0.2ms | 1 | `traverse` | uneval/src/index.ts:164:20 |
208
214
 
209
- ##### `getOwnPropertyDescriptor` (`<native>`)
215
+ ##### `getOwnPropertyDescriptor` (`<unknown>`)
210
216
 
211
217
  | % | Time | Samples | Caller | Location |
212
218
  | ----: | ------: | ------: | ---------------- | -------------------------- |
@@ -248,7 +254,7 @@ Callers ranked by contribution to each function's self time. Caller attribution
248
254
  | 29.9% | 20.4ms | 122 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
249
255
  | 29.4% | 20.1ms | 125 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
250
256
 
251
- ##### `/^[$_\p{ID_Start}][$_\p{ID_Continue}]*$/u` (`<native>`)
257
+ ##### `/^[$_\p{ID_Start}][$_\p{ID_Continue}]*$/u` (`<unknown>`)
252
258
 
253
259
  | % | Time | Samples | Caller | Location |
254
260
  | -----: | -----: | ------: | ------------------------ | ------------------------------------ |
@@ -273,34 +279,20 @@ Callers ranked by contribution to each function's self time. Caller attribution
273
279
  | -----: | -----: | ------: | ---------------- | ---------------------------------- |
274
280
  | 100.0% | 28.3ms | 178 | `unevalInternal` | uneval/src/internal/index.ts:25:32 |
275
281
 
276
- ##### `push` (`<native>`)
277
-
278
- | % | Time | Samples | Caller | Location |
279
- | ----: | ----: | ------: | ---------------- | -------------------------------------------------------------------------------------------- |
280
- | 45.3% | 5.9ms | 36 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
281
- | 28.8% | 3.7ms | 23 | `wrapper` | uneval/node_modules/.pnpm/fast-check@4.6.0/node_modules/fast-check/lib/fast-check.js:3113:9 |
282
- | 11.2% | 1.5ms | 9 | `generateNItems` | uneval/node_modules/.pnpm/fast-check@4.6.0/node_modules/fast-check/lib/fast-check.js:3097:16 |
283
- | 10.8% | 1.4ms | 9 | `tupleWrapper` | uneval/node_modules/.pnpm/fast-check@4.6.0/node_modules/fast-check/lib/fast-check.js:1023:22 |
284
- | 2.6% | 0.3ms | 2 | `traverseObject` | uneval/src/index.ts:204:26 |
282
+ ##### `push` (`<unknown>`)
285
283
 
286
- ##### `(anonymous)` (`<native>`)
284
+ | % | Time | Samples | Caller | Location |
285
+ | ----: | ----: | ------: | ------------------ | -------------------------------------- |
286
+ | 45.3% | 5.9ms | 36 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
287
+ | 2.6% | 0.3ms | 2 | `traverseObject` | uneval/src/index.ts:204:26 |
288
+ | 1.3% | 0.2ms | 1 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
287
289
 
288
- | % | Time | Samples | Caller | Location |
289
- | ---: | ----: | ------: | ------------- | ---------- |
290
- | 6.2% | 0.7ms | 5 | `(anonymous)` | `<native>` |
291
-
292
- ##### `map` (`<native>`)
290
+ ##### `map` (`<unknown>`)
293
291
 
294
292
  | % | Time | Samples | Caller | Location |
295
293
  | -----: | ----: | ------: | ------------------ | ------------------------------------ |
296
294
  | 100.0% | 8.2ms | 46 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
297
295
 
298
- ##### `parseModule` (`<native>`)
299
-
300
- | % | Time | Samples | Caller | Location |
301
- | -----: | ----: | ------: | ------------- | ---------- |
302
- | 100.0% | 7.5ms | 38 | `(anonymous)` | `<native>` |
303
-
304
296
  ##### `unevalInternal` (uneval/src/internal/index.ts:25:32)
305
297
 
306
298
  | % | Time | Samples | Caller | Location |
@@ -310,51 +302,49 @@ Callers ranked by contribution to each function's self time. Caller attribution
310
302
  | 4.4% | 0.3ms | 2 | `unevalObjectLiteralKey` | uneval/src/internal/object.ts:384:32 |
311
303
  | 2.2% | 0.2ms | 1 | `uneval` | uneval/src/index.ts:75:16 |
312
304
 
313
- ### Total time
305
+ ##### `unevalObjectInternal` (uneval/src/internal/object.ts:68:30)
314
306
 
315
- Functions ranked by total time spent in the function and all its callees.
307
+ | % | Time | Samples | Caller | Location |
308
+ | ----: | ----: | ------: | -------------- | -------------------------------------- |
309
+ | 96.7% | 5.3ms | 34 | `unevalObject` | uneval/src/internal/object.ts:20:29 |
310
+ | 3.3% | 0.2ms | 1 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
316
311
 
317
- | % | Time | Samples | Function | Location |
318
- | ----: | ------: | ------: | -------------------------- | -------------------------------------------------------------------------------------------- |
319
- | 98.9% | 2.42s | 15,097 | `loadAndEvaluateModule` | `<native>` |
320
- | 98.7% | 2.41s | 15,063 | `moduleEvaluation` | `<native>` |
321
- | 98.7% | 2.41s | 15,062 | `evaluate` | `<native>` |
322
- | 94.7% | 2.31s | 14,473 | `uneval` | uneval/src/index.ts:75:16 |
323
- | 52.5% | 1.28s | 8,030 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
324
- | 41.2% | 1s | 6,318 | `unevalInternal` | uneval/src/internal/index.ts:25:32 |
325
- | 33.1% | 809.8ms | 5,072 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
326
- | 30.0% | 734.8ms | 4,609 | `unevalString` | uneval/src/internal/primitive.ts:133:29 |
327
- | 28.7% | 701.7ms | 4,405 | `unevalLiteral` | uneval/src/internal/primitive.ts:139:23 |
328
- | 26.9% | 658.3ms | 4,095 | `createState` | uneval/src/index.ts:144:21 |
329
- | 25.6% | 625.9ms | 3,912 | `traverse` | uneval/src/index.ts:164:20 |
330
- | 25.5% | 623.7ms | 3,908 | `unevalObjectLiteralKey` | uneval/src/internal/object.ts:384:32 |
331
- | 23.8% | 582.9ms | 3,650 | `traverseObject` | uneval/src/index.ts:204:26 |
332
- | 11.5% | 281.3ms | 1,768 | `join` | `<native>` |
333
- | 9.5% | 232.9ms | 1,454 | `unevalNumber` | uneval/src/internal/primitive.ts:12:29 |
334
- | 7.2% | 176.8ms | 1,111 | `getOwnPropertyDescriptor` | `<native>` |
335
- | 4.5% | 110.1ms | 694 | `getType` | uneval/src/internal/type.ts:4:24 |
336
- | 3.5% | 84.5ms | 496 | `sample` | uneval/node_modules/.pnpm/fast-check@4.6.0/node_modules/fast-check/lib/fast-check.js:2551:16 |
337
- | 3.4% | 84.2ms | 494 | `performIteration` | `<native>` |
338
- | 3.4% | 84.1ms | 493 | `mapHelper` | uneval/node_modules/.pnpm/fast-check@4.6.0/node_modules/fast-check/lib/fast-check.js:58:27 |
312
+ ##### `unevalObjectAssign` (uneval/src/internal/collection.ts:89:28)
339
313
 
340
- #### Callees
314
+ | % | Time | Samples | Caller | Location |
315
+ | -----: | ----: | ------: | ------------- | -------------------------------------- |
316
+ | 100.0% | 4.1ms | 26 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
341
317
 
342
- Callees ranked by contribution to each function's total time. Callee attribution may be imprecise due to inlining.
318
+ ### Total time
343
319
 
344
- ##### `loadAndEvaluateModule` (`<native>`)
320
+ Functions ranked by total time spent in the function and all its callees.
345
321
 
346
- | % | Time | Samples | Callee | Location |
347
- | ----: | ----: | ------: | ----------------------- | ---------- |
348
- | 99.8% | 2.41s | 15,063 | `moduleEvaluation` | `<native>` |
349
- | 0.1% | 3.0ms | 22 | `linkAndEvaluateModule` | `<native>` |
350
- | 0.1% | 1.3ms | 9 | `loadModule` | `<native>` |
322
+ | % | Time | Samples | Function | Location |
323
+ | ----: | ------: | ------: | ------------------------------------------- | --------------------------------------- |
324
+ | 94.7% | 2.31s | 14,473 | `uneval` | uneval/src/index.ts:75:16 |
325
+ | 52.5% | 1.28s | 8,030 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
326
+ | 41.2% | 1s | 6,318 | `unevalInternal` | uneval/src/internal/index.ts:25:32 |
327
+ | 33.1% | 809.8ms | 5,072 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
328
+ | 30.0% | 734.8ms | 4,609 | `unevalString` | uneval/src/internal/primitive.ts:133:29 |
329
+ | 28.7% | 701.7ms | 4,405 | `unevalLiteral` | uneval/src/internal/primitive.ts:139:23 |
330
+ | 26.9% | 658.3ms | 4,095 | `createState` | uneval/src/index.ts:144:21 |
331
+ | 25.6% | 625.9ms | 3,912 | `traverse` | uneval/src/index.ts:164:20 |
332
+ | 25.5% | 623.7ms | 3,908 | `unevalObjectLiteralKey` | uneval/src/internal/object.ts:384:32 |
333
+ | 23.8% | 582.9ms | 3,650 | `traverseObject` | uneval/src/index.ts:204:26 |
334
+ | 11.5% | 281.3ms | 1,768 | `join` | `<unknown>` |
335
+ | 9.5% | 232.9ms | 1,454 | `unevalNumber` | uneval/src/internal/primitive.ts:12:29 |
336
+ | 7.2% | 176.8ms | 1,111 | `getOwnPropertyDescriptor` | `<unknown>` |
337
+ | 4.5% | 110.1ms | 694 | `getType` | uneval/src/internal/type.ts:4:24 |
338
+ | 2.2% | 54.8ms | 341 | `/^[$_\p{ID_Start}][$_\p{ID_Continue}]*$/u` | `<unknown>` |
339
+ | 1.2% | 28.3ms | 178 | `unevalBoolean` | uneval/src/internal/primitive.ts:8:30 |
340
+ | 0.5% | 13.0ms | 80 | `push` | `<unknown>` |
341
+ | 0.4% | 8.6ms | 55 | `unevalObject` | uneval/src/internal/object.ts:20:29 |
342
+ | 0.3% | 8.2ms | 46 | `map` | `<unknown>` |
343
+ | 0.2% | 5.5ms | 35 | `unevalObjectInternal` | uneval/src/internal/object.ts:68:30 |
351
344
 
352
- ##### `moduleEvaluation` (`<native>`)
345
+ #### Callees
353
346
 
354
- | % | Time | Samples | Callee | Location |
355
- | -----: | ----: | ------: | ------------------ | ---------- |
356
- | 100.0% | 2.41s | 15,062 | `evaluate` | `<native>` |
357
- | 100.0% | 2.41s | 15,061 | `moduleEvaluation` | `<native>` |
347
+ Callees ranked by contribution to each function's total time. Callee attribution may be imprecise due to inlining.
358
348
 
359
349
  ##### `uneval` (uneval/src/index.ts:75:16)
360
350
 
@@ -374,7 +364,7 @@ Callees ranked by contribution to each function's total time. Callee attribution
374
364
  | 25.1% | 322.7ms | 2,008 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
375
365
  | 19.8% | 254.1ms | 1,590 | `unevalInternal` | uneval/src/internal/index.ts:25:32 |
376
366
  | 16.7% | 214.8ms | 1,337 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
377
- | 13.5% | 173.9ms | 1,091 | `join` | `<native>` |
367
+ | 13.5% | 173.9ms | 1,091 | `join` | `<unknown>` |
378
368
 
379
369
  ##### `unevalInternal` (uneval/src/internal/index.ts:25:32)
380
370
 
@@ -392,8 +382,8 @@ Callees ranked by contribution to each function's total time. Callee attribution
392
382
  | 45.4% | 367.7ms | 2,300 | `unevalObjectLike` | uneval/src/internal/object.ts:103:26 |
393
383
  | 33.2% | 268.5ms | 1,684 | `unevalInternal` | uneval/src/internal/index.ts:25:32 |
394
384
  | 19.9% | 161.4ms | 1,006 | `unevalArray` | uneval/src/internal/collection.ts:7:47 |
395
- | 13.1% | 105.9ms | 668 | `join` | `<native>` |
396
- | 0.7% | 5.9ms | 36 | `push` | `<native>` |
385
+ | 13.1% | 105.9ms | 668 | `join` | `<unknown>` |
386
+ | 0.7% | 5.9ms | 36 | `push` | `<unknown>` |
397
387
 
398
388
  ##### `unevalString` (uneval/src/internal/primitive.ts:133:29)
399
389
 
@@ -403,11 +393,11 @@ Callees ranked by contribution to each function's total time. Callee attribution
403
393
 
404
394
  ##### `unevalLiteral` (uneval/src/internal/primitive.ts:139:23)
405
395
 
406
- | % | Time | Samples | Callee | Location |
407
- | ---: | ----: | ------: | ------------- | ---------- |
408
- | 0.0% | 0.2ms | 1 | `charCodeAt` | `<native>` |
409
- | 0.0% | 0.2ms | 1 | `(unknown)` | `<native>` |
410
- | 0.0% | 0.1ms | 1 | `toLowerCase` | `<native>` |
396
+ | % | Time | Samples | Callee | Location |
397
+ | ---: | ----: | ------: | ------------- | ----------- |
398
+ | 0.0% | 0.2ms | 1 | `charCodeAt` | `<unknown>` |
399
+ | 0.0% | 0.2ms | 1 | `(unknown)` | `<unknown>` |
400
+ | 0.0% | 0.1ms | 1 | `toLowerCase` | `<unknown>` |
411
401
 
412
402
  ##### `createState` (uneval/src/index.ts:144:21)
413
403
 
@@ -420,7 +410,7 @@ Callees ranked by contribution to each function's total time. Callee attribution
420
410
  | % | Time | Samples | Callee | Location |
421
411
  | ----: | ------: | ------: | -------------------------- | -------------------------------------- |
422
412
  | 93.1% | 582.9ms | 3,650 | `traverseObject` | uneval/src/index.ts:204:26 |
423
- | 0.1% | 0.5ms | 3 | `getOwnPropertyDescriptor` | `<native>` |
413
+ | 0.1% | 0.5ms | 3 | `getOwnPropertyDescriptor` | `<unknown>` |
424
414
  | 0.0% | 0.2ms | 1 | `unevalNumber` | uneval/src/internal/primitive.ts:12:29 |
425
415
  | 0.0% | 0.2ms | 1 | `unevalInternal` | uneval/src/internal/index.ts:25:32 |
426
416
 
@@ -429,7 +419,7 @@ Callees ranked by contribution to each function's total time. Callee attribution
429
419
  | % | Time | Samples | Callee | Location |
430
420
  | ----: | ------: | ------: | ------------------------------------------- | --------------------------------------- |
431
421
  | 72.5% | 452.4ms | 2,838 | `unevalInternal` | uneval/src/internal/index.ts:25:32 |
432
- | 8.8% | 54.8ms | 341 | `/^[$_\p{ID_Start}][$_\p{ID_Continue}]*$/u` | `<native>` |
422
+ | 8.8% | 54.8ms | 341 | `/^[$_\p{ID_Start}][$_\p{ID_Continue}]*$/u` | `<unknown>` |
433
423
  | 0.0% | 0.1ms | 1 | `unevalString` | uneval/src/internal/primitive.ts:133:29 |
434
424
 
435
425
  ##### `traverseObject` (uneval/src/index.ts:204:26)
@@ -437,41 +427,29 @@ Callees ranked by contribution to each function's total time. Callee attribution
437
427
  | % | Time | Samples | Callee | Location |
438
428
  | ----: | ------: | ------: | -------------------------- | -------------------------------- |
439
429
  | 50.3% | 293.4ms | 1,842 | `traverse` | uneval/src/index.ts:164:20 |
440
- | 30.3% | 176.4ms | 1,108 | `getOwnPropertyDescriptor` | `<native>` |
430
+ | 30.3% | 176.4ms | 1,108 | `getOwnPropertyDescriptor` | `<unknown>` |
441
431
  | 18.9% | 110.1ms | 694 | `getType` | uneval/src/internal/type.ts:4:24 |
442
- | 0.1% | 0.3ms | 2 | `push` | `<native>` |
443
- | 0.0% | 0.1ms | 1 | `ownKeys` | `<native>` |
432
+ | 0.1% | 0.3ms | 2 | `push` | `<unknown>` |
433
+ | 0.0% | 0.1ms | 1 | `ownKeys` | `<unknown>` |
444
434
 
445
435
  ##### `getType` (uneval/src/internal/type.ts:4:24)
446
436
 
447
- | % | Time | Samples | Callee | Location |
448
- | ---: | ----: | ------: | ---------- | ---------- |
449
- | 0.4% | 0.5ms | 3 | `toString` | `<native>` |
450
-
451
- ##### `sample` (uneval/node_modules/.pnpm/fast-check@4.6.0/node_modules/fast-check/lib/fast-check.js:2551:16)
452
-
453
- | % | Time | Samples | Callee | Location |
454
- | ----: | -----: | ------: | ------------------ | -------------------------------------------------------------------------------------------- |
455
- | 99.7% | 84.2ms | 494 | `performIteration` | `<native>` |
456
- | 0.3% | 0.3ms | 2 | `streamSample` | uneval/node_modules/.pnpm/fast-check@4.6.0/node_modules/fast-check/lib/fast-check.js:2524:22 |
457
-
458
- ##### `performIteration` (`<native>`)
459
-
460
- | % | Time | Samples | Callee | Location |
461
- | ----: | -----: | ------: | ----------------- | ---------- |
462
- | 99.8% | 84.1ms | 493 | `generatorResume` | `<native>` |
437
+ | % | Time | Samples | Callee | Location |
438
+ | ---: | ----: | ------: | ---------- | ----------- |
439
+ | 0.4% | 0.5ms | 3 | `toString` | `<unknown>` |
463
440
 
464
- ##### `mapHelper` (uneval/node_modules/.pnpm/fast-check@4.6.0/node_modules/fast-check/lib/fast-check.js:58:27)
441
+ ##### `unevalObject` (uneval/src/internal/object.ts:20:29)
465
442
 
466
- | % | Time | Samples | Callee | Location |
467
- | ----: | -----: | ------: | ----------------- | ---------- |
468
- | 99.8% | 83.9ms | 492 | `generatorResume` | `<native>` |
443
+ | % | Time | Samples | Callee | Location |
444
+ | ----: | ----: | ------: | ---------------------- | ----------------------------------- |
445
+ | 61.6% | 5.3ms | 34 | `unevalObjectInternal` | uneval/src/internal/object.ts:68:30 |
446
+ | 2.0% | 0.2ms | 1 | `get` | `<unknown>` |
469
447
 
470
448
  ## Hottest call stacks
471
449
 
472
- Call stacks ranked by time spent in their top frame.
450
+ Call stacks ranked by time spent in their leaf frame.
473
451
 
474
- Common call stack: `uneval` (uneval/src/index.ts:75:16) ← `evaluate` ← `moduleEvaluation` ← `moduleEvaluation` ← `loadAndEvaluateModule`
452
+ Common call stack: `uneval` (uneval/src/index.ts:75:16)
475
453
 
476
454
  | % | Time | Samples | Call stack |
477
455
  | ---: | ------: | ------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |