profiler-md 0.8.0 → 0.9.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.
- package/dist/cli/index.mjs +22206 -13852
- package/dist/index.d.mts +2677 -787
- package/dist/index.js +2 -2
- package/dist/man/profiler-md.1 +150 -0
- package/dist/node/index.mjs +2 -0
- package/docs/CLAUDE.md +22 -0
- package/docs/api.md +51 -11
- package/docs/formats/ghc-eventlog.md +6 -4
- package/docs/formats/ghc-json-profile.md +1 -1
- package/docs/formats/hprof.md +1 -2
- package/docs/formats/jfr.md +1 -1
- package/docs/formats/jsc-heap-snapshot.md +9 -8
- package/docs/formats/memray.md +9 -14
- package/docs/formats/perf.md +24 -34
- package/docs/formats/pprof.md +6 -4
- package/docs/formats/speedscope.md +3 -3
- package/docs/formats/systing.md +1 -1
- package/docs/formats/trace-event.md +20 -0
- package/docs/formats/v8-cpu-profile.md +1 -1
- package/docs/formats/v8-heap-profile.md +5 -6
- package/docs/formats/v8-heap-snapshot.md +10 -9
- package/docs/formats/webkit-timeline-recording.md +2 -3
- package/docs/languages/c.md +99 -45
- package/docs/languages/elixir.md +4 -3
- package/docs/languages/fortran.md +10 -9
- package/docs/languages/haskell.md +1 -1
- package/docs/languages/java.md +43 -6
- package/docs/languages/javascript.md +107 -3
- package/docs/languages/nix.md +56 -0
- package/docs/languages/python.md +87 -30
- package/docs/languages/swift.md +11 -10
- package/docs/languages/zig.md +45 -47
- package/package.json +53 -34
- package/readme.md +368 -174
- package/skills/profile-optimize/SKILL.md +259 -133
package/docs/languages/python.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Python
|
|
2
2
|
|
|
3
|
-
Python profiling uses [py-spy](https://github.com/benfred/py-spy),
|
|
3
|
+
Python profiling uses [py-spy](https://github.com/benfred/py-spy), Tachyon (the
|
|
4
|
+
[sampling profiler](https://docs.python.org/3.15/library/profiling.sampling.html)
|
|
5
|
+
built into Python 3.15),
|
|
4
6
|
[pyinstrument](https://github.com/joerick/pyinstrument),
|
|
5
7
|
[memray](https://github.com/bloomberg/memray), or
|
|
6
8
|
[systing](https://github.com/josefbacik/systing).
|
|
@@ -9,6 +11,8 @@ Python profiling uses [py-spy](https://github.com/benfred/py-spy),
|
|
|
9
11
|
|
|
10
12
|
Periodically samples the call stack. Useful for finding CPU hot spots.
|
|
11
13
|
|
|
14
|
+
### py-spy
|
|
15
|
+
|
|
12
16
|
```sh
|
|
13
17
|
# Collapsed format (wrap a script)
|
|
14
18
|
py-spy record -f raw -o cpu.collapsed -- python script.py
|
|
@@ -23,51 +27,63 @@ py-spy record -f raw -o cpu.collapsed --pid <pid>
|
|
|
23
27
|
py-spy record -f raw -o cpu.collapsed --native -- python script.py
|
|
24
28
|
```
|
|
25
29
|
|
|
30
|
+
### Tachyon
|
|
31
|
+
|
|
32
|
+
Tachyon ships with Python 3.15 as `profiling.sampling`. It reads the call stack
|
|
33
|
+
of another interpreter process through the remote debugging interface, so it
|
|
34
|
+
requires no extension and adds no code to the profiled program. Pass
|
|
35
|
+
`--mode cpu` because the default mode samples wall-clock time.
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
# Profile a script
|
|
39
|
+
python -m profiling.sampling run --mode cpu --collapsed -o cpu.collapsed script.py
|
|
40
|
+
|
|
41
|
+
# Profile a module, as `python -m` would run it
|
|
42
|
+
python -m profiling.sampling run --mode cpu --collapsed -o cpu.collapsed -m black .
|
|
43
|
+
|
|
44
|
+
# Attach to a running process
|
|
45
|
+
python -m profiling.sampling attach --mode cpu --collapsed -o cpu.collapsed <pid>
|
|
46
|
+
```
|
|
47
|
+
|
|
26
48
|
## Wall-clock profiling
|
|
27
49
|
|
|
28
50
|
Samples wall-clock time rather than CPU time, including time threads spend
|
|
29
51
|
waiting. Useful for I/O-bound or latency-sensitive code.
|
|
30
52
|
|
|
53
|
+
### py-spy
|
|
54
|
+
|
|
31
55
|
```sh
|
|
32
56
|
py-spy record -f raw -o wall.collapsed --idle -- python script.py
|
|
33
57
|
```
|
|
34
58
|
|
|
35
|
-
|
|
59
|
+
### Tachyon
|
|
36
60
|
|
|
37
|
-
|
|
38
|
-
diagnosing hangs, deadlocks, or unexpected blocking.
|
|
61
|
+
Wall-clock time is Tachyon's default mode.
|
|
39
62
|
|
|
40
63
|
```sh
|
|
41
|
-
#
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# Include local variables in each frame
|
|
45
|
-
py-spy dump --pid <pid> --locals
|
|
46
|
-
```
|
|
64
|
+
# Profile a script
|
|
65
|
+
python -m profiling.sampling run --collapsed -o wall.collapsed script.py
|
|
47
66
|
|
|
48
|
-
|
|
67
|
+
# Sample every thread instead of the main thread
|
|
68
|
+
python -m profiling.sampling run --collapsed -o wall.collapsed -a script.py
|
|
49
69
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
| `-o` / `--output` | — | Output file path |
|
|
54
|
-
| `-d` / `--duration` | — | Duration in seconds (default: until program exits) |
|
|
55
|
-
| `-r` / `--rate` | `100` | Sampling rate in Hz |
|
|
56
|
-
| `--idle` | off | Include stack traces for idle (sleeping/waiting) threads |
|
|
57
|
-
| `--native` | off | Profile native Cython or C extensions |
|
|
58
|
-
| `--nonblocking` | off | Sample without pausing the process (less accurate) |
|
|
59
|
-
| `--subprocesses` | off | Also profile subprocesses of the target |
|
|
70
|
+
# Mark where the interpreter was running non-Python code with a `<native>` frame
|
|
71
|
+
python -m profiling.sampling run --collapsed -o wall.collapsed --native script.py
|
|
72
|
+
```
|
|
60
73
|
|
|
61
|
-
|
|
74
|
+
The other modes keep a subset of the wall-clock samples. `--mode gil` keeps the
|
|
75
|
+
samples taken while the thread held the GIL, and `--mode exception` keeps those
|
|
76
|
+
taken while it had an exception in flight or was running an `except` block.
|
|
62
77
|
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
```sh
|
|
79
|
+
python -m profiling.sampling run --mode gil --collapsed -o gil.collapsed script.py
|
|
80
|
+
python -m profiling.sampling run --mode exception --collapsed -o exception.collapsed script.py
|
|
81
|
+
```
|
|
65
82
|
|
|
66
|
-
|
|
67
|
-
from inside the interpreter, so it needs no ptrace access. Its speedscope
|
|
68
|
-
renderer writes a format this tool reads.
|
|
83
|
+
### pyinstrument
|
|
69
84
|
|
|
70
|
-
|
|
85
|
+
pyinstrument samples the call stack from inside the interpreter, so it needs no
|
|
86
|
+
ptrace access. Its speedscope renderer writes a format this tool reads.
|
|
71
87
|
|
|
72
88
|
```sh
|
|
73
89
|
# Profile a script
|
|
@@ -88,7 +104,48 @@ export covers only the imports. `--show-all` can trim the run the same way.
|
|
|
88
104
|
By default the export keeps the frames above 1% of the total and folds the rest
|
|
89
105
|
into the self time of the frame that called them.
|
|
90
106
|
|
|
91
|
-
|
|
107
|
+
## Call stack dump
|
|
108
|
+
|
|
109
|
+
Captures the current call stacks of all threads in a running process. Useful for
|
|
110
|
+
diagnosing hangs, deadlocks, or unexpected blocking.
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
# Dump call stacks of a running process (text output)
|
|
114
|
+
py-spy dump --pid <pid>
|
|
115
|
+
|
|
116
|
+
# Include local variables in each frame
|
|
117
|
+
py-spy dump --pid <pid> --locals
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## py-spy CLI flags
|
|
121
|
+
|
|
122
|
+
| Flag | Default | Description |
|
|
123
|
+
| ------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
124
|
+
| `-f` / `--format` | `flamegraph` | Output format: `flamegraph`, `raw`, `speedscope`, `chrometrace` |
|
|
125
|
+
| `-o` / `--output` | — | Output file path |
|
|
126
|
+
| `-d` / `--duration` | — | Duration in seconds (default: until program exits) |
|
|
127
|
+
| `-r` / `--rate` | `100` | Sampling rate in Hz |
|
|
128
|
+
| `--idle` | off | Include stack traces for idle (sleeping/waiting) threads |
|
|
129
|
+
| `--native` | off | Profile native Cython or C extensions |
|
|
130
|
+
| `--function` | off | Record the first line of each function in place of the executing line. py-spy's output omits the mode, so each function's `Lines` section lists the definition line as if it were the executing line |
|
|
131
|
+
| `--nonblocking` | off | Sample without pausing the process (less accurate) |
|
|
132
|
+
| `--subprocesses` | off | Also profile subprocesses of the target |
|
|
133
|
+
|
|
134
|
+
## Tachyon CLI flags
|
|
135
|
+
|
|
136
|
+
| Flag | Default | Description |
|
|
137
|
+
| ------------------------ | ------- | --------------------------------------------------------------------- |
|
|
138
|
+
| `--collapsed` | off | Write collapsed stacks instead of the default `pstats` output |
|
|
139
|
+
| `-o` / `--output` | — | Output file path |
|
|
140
|
+
| `-r` / `--sampling-rate` | `1khz` | Samples per second |
|
|
141
|
+
| `-d` / `--duration` | — | Duration in seconds (default: until the program exits) |
|
|
142
|
+
| `--mode` | `wall` | What to sample: `wall`, `cpu`, `gil`, or `exception` |
|
|
143
|
+
| `-a` / `--all-threads` | off | Sample every thread instead of the main thread |
|
|
144
|
+
| `--native` | off | Include a `<native>` frame where the interpreter runs non-Python code |
|
|
145
|
+
| `--no-gc` | off | Omit the `<GC>` frames garbage collection adds |
|
|
146
|
+
| `--subprocesses` | off | Also profile subprocesses of the target |
|
|
147
|
+
|
|
148
|
+
## pyinstrument CLI flags
|
|
92
149
|
|
|
93
150
|
| Flag | Default | Description |
|
|
94
151
|
| --------------------- | --------- | ------------------------------------------------------------- |
|
|
@@ -139,7 +196,7 @@ profile a workload small enough to finish with tracing on.
|
|
|
139
196
|
| `-o` / `--output` | `<process_name>.<pid>.bin` | Output file path |
|
|
140
197
|
| `-f` / `--force` | off | Overwrite the output file if it exists |
|
|
141
198
|
| `--aggregate` | off | Record each stack's totals instead of every allocation |
|
|
142
|
-
| `--native` | off | Also record C/C++ frames
|
|
199
|
+
| `--native` | off | Also record C/C++ frames |
|
|
143
200
|
| `--trace-python-allocators` | off | Record pymalloc's own allocations as well as the ones underneath it |
|
|
144
201
|
| `--follow-fork` | off | Also trace child processes, each into its own capture |
|
|
145
202
|
| `--no-compress` | off | Write the capture uncompressed rather than LZ4 compressed |
|
package/docs/languages/swift.md
CHANGED
|
@@ -73,7 +73,7 @@ swiftc -O -g program.swift -o program -Xlinker --no-as-needed -Xlinker -ltcmallo
|
|
|
73
73
|
|
|
74
74
|
```sh
|
|
75
75
|
# Generate heap profiles (written as <prefix>.0001.heap, .0002.heap, …)
|
|
76
|
-
HEAPPROFILE=heap.prof ./program
|
|
76
|
+
TCMALLOC_STACKTRACE_METHOD=libgcc HEAPPROFILE=heap.prof ./program
|
|
77
77
|
|
|
78
78
|
# Convert a heap profile to pprof protobuf format
|
|
79
79
|
pprof --proto ./program heap.prof.0001.heap > heap.pprof
|
|
@@ -81,14 +81,15 @@ pprof --proto ./program heap.prof.0001.heap > heap.pprof
|
|
|
81
81
|
|
|
82
82
|
#### Environment variables
|
|
83
83
|
|
|
84
|
-
| Variable | Default | Description
|
|
85
|
-
| ---------------------------------- | ------------ |
|
|
86
|
-
| `HEAPPROFILE` | — | Output filename prefix that enables heap profiling when set
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
84
|
+
| Variable | Default | Description |
|
|
85
|
+
| ---------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
86
|
+
| `HEAPPROFILE` | — | Output filename prefix that enables heap profiling when set |
|
|
87
|
+
| `TCMALLOC_STACKTRACE_METHOD` | — | Stack unwinder. `libgcc` reads unwind tables, so it walks through libraries built without frame pointers, such as libc, where the frame-pointer walk ends in invalid frames |
|
|
88
|
+
| `HEAP_PROFILE_ALLOCATION_INTERVAL` | `1073741824` | Dump a profile after every this many bytes allocated (default 1 GB) |
|
|
89
|
+
| `HEAP_PROFILE_INUSE_INTERVAL` | `104857600` | Dump a profile each time the in-use high-water mark grows by this many bytes (default 100 MB) |
|
|
90
|
+
| `HEAP_PROFILE_TIME_INTERVAL` | `0` | Dump a profile every this many seconds (disabled by default) |
|
|
91
|
+
| `HEAPPROFILESIGNAL` | — | Signal number to dump a profile on demand |
|
|
92
|
+
| `HEAP_PROFILE_MMAP` | `false` | Also profile `mmap`/`mremap`/`sbrk` calls |
|
|
92
93
|
|
|
93
94
|
## Tips
|
|
94
95
|
|
|
@@ -112,7 +113,7 @@ above into `Lexer.Cursor.advance(if:)`.
|
|
|
112
113
|
|
|
113
114
|
```sh
|
|
114
115
|
CPUPROFILE=cpu.prof LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libprofiler.so ./program
|
|
115
|
-
HEAPPROFILE=heap.prof LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc.so ./program
|
|
116
|
+
TCMALLOC_STACKTRACE_METHOD=libgcc HEAPPROFILE=heap.prof LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc.so ./program
|
|
116
117
|
```
|
|
117
118
|
|
|
118
119
|
### Symbols
|
package/docs/languages/zig.md
CHANGED
|
@@ -9,6 +9,8 @@ program from the kernel.
|
|
|
9
9
|
|
|
10
10
|
Periodically samples the call stack. Useful for finding CPU hot spots.
|
|
11
11
|
|
|
12
|
+
### gperftools
|
|
13
|
+
|
|
12
14
|
Link libc dynamically so the profiler can be preloaded, and keep frame pointers
|
|
13
15
|
so its unwinder can walk the stack:
|
|
14
16
|
|
|
@@ -16,7 +18,7 @@ so its unwinder can walk the stack:
|
|
|
16
18
|
zig build-exe -O ReleaseSafe -fno-omit-frame-pointer -lc program.zig
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
#### CLI
|
|
20
22
|
|
|
21
23
|
```sh
|
|
22
24
|
# Generate a CPU profile
|
|
@@ -35,7 +37,7 @@ pprof --proto ./program cpu.prof > cpu.pprof
|
|
|
35
37
|
| `CPUPROFILE_REALTIME` | — | Use wall-clock time (`ITIMER_REAL`) instead of CPU time (`ITIMER_PROF`) when set |
|
|
36
38
|
| `CPUPROFILESIGNAL` | — | Signal number to toggle profiling on/off at runtime |
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
#### Programmatic API
|
|
39
41
|
|
|
40
42
|
Declare the C entry points and link `-lprofiler`:
|
|
41
43
|
|
|
@@ -54,47 +56,11 @@ ProfilerStop();
|
|
|
54
56
|
zig build-exe -O ReleaseSafe -fno-omit-frame-pointer -lc -lprofiler program.zig
|
|
55
57
|
```
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Periodically dumps the live heap, capturing allocation stack traces. Useful for
|
|
60
|
-
finding memory leaks and allocation hot spots.
|
|
61
|
-
|
|
62
|
-
Allocate through `std.heap.c_allocator`, which routes every allocation to
|
|
63
|
-
`malloc` and so to tcmalloc:
|
|
64
|
-
|
|
65
|
-
```zig
|
|
66
|
-
const gpa = std.heap.c_allocator;
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### CLI
|
|
70
|
-
|
|
71
|
-
```sh
|
|
72
|
-
# Generate heap profiles (written as <prefix>.0001.heap, .0002.heap, …)
|
|
73
|
-
HEAPPROFILE=heap.prof LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc.so ./program
|
|
74
|
-
|
|
75
|
-
# Convert a heap profile to pprof protobuf format
|
|
76
|
-
pprof --proto ./program heap.prof.0001.heap > heap.pprof
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
#### Environment variables
|
|
80
|
-
|
|
81
|
-
| Variable | Default | Description |
|
|
82
|
-
| ---------------------------------- | ------------ | --------------------------------------------------------------------------------------------- |
|
|
83
|
-
| `HEAPPROFILE` | — | Output filename prefix that enables heap profiling when set |
|
|
84
|
-
| `HEAP_PROFILE_ALLOCATION_INTERVAL` | `1073741824` | Dump a profile after every this many bytes allocated (default 1 GB) |
|
|
85
|
-
| `HEAP_PROFILE_INUSE_INTERVAL` | `104857600` | Dump a profile each time the in-use high-water mark grows by this many bytes (default 100 MB) |
|
|
86
|
-
| `HEAP_PROFILE_TIME_INTERVAL` | `0` | Dump a profile every this many seconds (disabled by default) |
|
|
87
|
-
| `HEAPPROFILESIGNAL` | — | Signal number to dump a profile on demand |
|
|
88
|
-
| `HEAP_PROFILE_MMAP` | `false` | Also profile `mmap`/`mremap`/`sbrk` calls |
|
|
59
|
+
### Linux perf
|
|
89
60
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
user and kernel code. Useful for finding CPU hot spots, including the ones in
|
|
94
|
-
the kernel.
|
|
95
|
-
|
|
96
|
-
[Linux `perf`](https://perfwiki.github.io/main/) samples any native program and
|
|
97
|
-
writes `perf.data` itself. It needs a Linux kernel and a
|
|
61
|
+
[Linux `perf`](https://perfwiki.github.io/main/) samples any native program
|
|
62
|
+
through the kernel's `perf_event` counters, across user and kernel code, and
|
|
63
|
+
writes `perf.data`. It needs a Linux kernel and a
|
|
98
64
|
`/proc/sys/kernel/perf_event_paranoid` low enough to permit sampling (`1` or
|
|
99
65
|
below for kernel stacks).
|
|
100
66
|
|
|
@@ -104,8 +70,6 @@ Build with frame pointers so perf's unwinder can walk the stack:
|
|
|
104
70
|
zig build-exe -O ReleaseSafe -fno-omit-frame-pointer program.zig
|
|
105
71
|
```
|
|
106
72
|
|
|
107
|
-
### CLI
|
|
108
|
-
|
|
109
73
|
```sh
|
|
110
74
|
# Sample a command at 999 Hz, recording call chains
|
|
111
75
|
perf record -F 999 -g -o perf.data -- ./program args
|
|
@@ -114,7 +78,10 @@ perf record -F 999 -g -o perf.data -- ./program args
|
|
|
114
78
|
perf record -F 999 -g -o perf.data --pid <pid> -- sleep 30
|
|
115
79
|
```
|
|
116
80
|
|
|
117
|
-
|
|
81
|
+
A `perf.data` file contains addresses rather than function names. See
|
|
82
|
+
`profiler-md --help perf` for how frames are named and how to symbolize them.
|
|
83
|
+
|
|
84
|
+
## Linux perf CLI flags
|
|
118
85
|
|
|
119
86
|
| Flag | Default | Description |
|
|
120
87
|
| -------------- | ----------- | -------------------------------------------------------------------- |
|
|
@@ -125,8 +92,39 @@ perf record -F 999 -g -o perf.data --pid <pid> -- sleep 30
|
|
|
125
92
|
| `-o` | `perf.data` | Output path |
|
|
126
93
|
| `-a` | off | Sample every CPU on the system rather than one command |
|
|
127
94
|
|
|
128
|
-
|
|
129
|
-
|
|
95
|
+
## Memory profiling
|
|
96
|
+
|
|
97
|
+
Periodically dumps the live heap, capturing allocation stack traces. Useful for
|
|
98
|
+
finding memory leaks and allocation hot spots.
|
|
99
|
+
|
|
100
|
+
Allocate through `std.heap.c_allocator`, which routes every allocation to
|
|
101
|
+
`malloc` and so to tcmalloc:
|
|
102
|
+
|
|
103
|
+
```zig
|
|
104
|
+
const gpa = std.heap.c_allocator;
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### CLI
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
# Generate heap profiles (written as <prefix>.0001.heap, .0002.heap, …)
|
|
111
|
+
TCMALLOC_STACKTRACE_METHOD=libgcc HEAPPROFILE=heap.prof LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc.so ./program
|
|
112
|
+
|
|
113
|
+
# Convert a heap profile to pprof protobuf format
|
|
114
|
+
pprof --proto ./program heap.prof.0001.heap > heap.pprof
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Environment variables
|
|
118
|
+
|
|
119
|
+
| Variable | Default | Description |
|
|
120
|
+
| ---------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
121
|
+
| `HEAPPROFILE` | — | Output filename prefix that enables heap profiling when set |
|
|
122
|
+
| `TCMALLOC_STACKTRACE_METHOD` | — | Stack unwinder. `libgcc` reads unwind tables, so it walks through libraries built without frame pointers, such as libc, where the frame-pointer walk ends in invalid frames |
|
|
123
|
+
| `HEAP_PROFILE_ALLOCATION_INTERVAL` | `1073741824` | Dump a profile after every this many bytes allocated (default 1 GB) |
|
|
124
|
+
| `HEAP_PROFILE_INUSE_INTERVAL` | `104857600` | Dump a profile each time the in-use high-water mark grows by this many bytes (default 100 MB) |
|
|
125
|
+
| `HEAP_PROFILE_TIME_INTERVAL` | `0` | Dump a profile every this many seconds (disabled by default) |
|
|
126
|
+
| `HEAPPROFILESIGNAL` | — | Signal number to dump a profile on demand |
|
|
127
|
+
| `HEAP_PROFILE_MMAP` | `false` | Also profile `mmap`/`mremap`/`sbrk` calls |
|
|
130
128
|
|
|
131
129
|
## Tips
|
|
132
130
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "profiler-md",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Tomer Aberbach",
|
|
6
6
|
"email": "tomer@aberba.ch",
|
|
@@ -50,18 +50,28 @@
|
|
|
50
50
|
"type": "module",
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"engines": {
|
|
53
|
-
"node": ">=
|
|
53
|
+
"node": "^22.18.0 || >=24"
|
|
54
54
|
},
|
|
55
55
|
"bin": {
|
|
56
56
|
"profiler-md": "./dist/cli/index.mjs"
|
|
57
57
|
},
|
|
58
|
+
"man": [
|
|
59
|
+
"./dist/man/profiler-md.1"
|
|
60
|
+
],
|
|
58
61
|
"exports": {
|
|
59
62
|
".": {
|
|
60
63
|
"types": "./dist/index.d.mts",
|
|
64
|
+
"node": "./dist/node/index.mjs",
|
|
61
65
|
"default": "./dist/index.js"
|
|
62
66
|
},
|
|
63
67
|
"./package.json": "./package.json"
|
|
64
68
|
},
|
|
69
|
+
"imports": {
|
|
70
|
+
"#compression": {
|
|
71
|
+
"node": "./src/formats/compression.node.ts",
|
|
72
|
+
"default": "./src/formats/compression.web.ts"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
65
75
|
"scripts": {
|
|
66
76
|
"format:base": "prettier --cache --write",
|
|
67
77
|
"format": "pnpm format:base .",
|
|
@@ -73,59 +83,68 @@
|
|
|
73
83
|
"coverage": "vitest --coverage",
|
|
74
84
|
"bench": "./scripts/bench",
|
|
75
85
|
"categories": "node scripts/categories.ts",
|
|
76
|
-
"
|
|
86
|
+
"evaluate-diff-matching": "node scripts/evaluate-diff-matching/index.ts",
|
|
87
|
+
"check-diff-matching": "node scripts/evaluate-diff-matching/index.ts --check",
|
|
88
|
+
"evaluate-call-tree": "node scripts/evaluate-call-tree/index.ts",
|
|
89
|
+
"build": "tsdown && node scripts/build-man.ts",
|
|
77
90
|
"generate-inputs": "./scripts/generate-inputs",
|
|
78
91
|
"update-readme": "node scripts/update-readme.ts",
|
|
79
92
|
"check-readme": "node scripts/update-readme.ts --check",
|
|
80
93
|
"update-demo": "node scripts/update-demo.ts",
|
|
81
94
|
"check-demo": "node scripts/update-demo.ts --check",
|
|
82
|
-
"update-examples": "node scripts/update-examples.ts",
|
|
83
|
-
"check-examples": "node scripts/update-examples.ts --check",
|
|
84
|
-
"check": "
|
|
85
|
-
"check
|
|
86
|
-
"check
|
|
95
|
+
"update-examples": "node scripts/update-examples/index.ts",
|
|
96
|
+
"check-examples": "node scripts/update-examples/index.ts --check",
|
|
97
|
+
"check-input-privacy": "node scripts/check-input-privacy.ts",
|
|
98
|
+
"check-bash": "./scripts/check-bash",
|
|
99
|
+
"check": "node scripts/check.ts",
|
|
100
|
+
"check:inputs": "node scripts/check.ts inputs",
|
|
101
|
+
"check:static": "node scripts/check.ts static",
|
|
87
102
|
"prepublishOnly": "pnpm build"
|
|
88
103
|
},
|
|
89
104
|
"prettier": "@tomer/prettier-config",
|
|
90
105
|
"dependencies": {
|
|
91
|
-
"@optique/core": "^1.
|
|
92
|
-
"@optique/run": "^1.
|
|
93
|
-
"@shikijs/core": "^4.
|
|
94
|
-
"@shikijs/engine-oniguruma": "^4.
|
|
95
|
-
"@shikijs/langs": "^4.
|
|
96
|
-
"ansis": "^4.
|
|
106
|
+
"@optique/core": "^1.3.6",
|
|
107
|
+
"@optique/run": "^1.3.6",
|
|
108
|
+
"@shikijs/core": "^4.5.0",
|
|
109
|
+
"@shikijs/engine-oniguruma": "^4.5.0",
|
|
110
|
+
"@shikijs/langs": "^4.5.0",
|
|
111
|
+
"ansis": "^4.4.0",
|
|
97
112
|
"convert-source-map": "^2.0.0",
|
|
98
|
-
"globals": "^17.
|
|
113
|
+
"globals": "^17.13.0",
|
|
99
114
|
"jumbo-json": "^0.2.0",
|
|
100
|
-
"mdast-util-from-markdown": "^2.0
|
|
115
|
+
"mdast-util-from-markdown": "^2.1.0",
|
|
101
116
|
"mdast-util-gfm-table": "^2.0.0",
|
|
102
|
-
"mdast-util-to-markdown": "^2.
|
|
103
|
-
"micromark-extension-gfm-table": "^2.1.
|
|
117
|
+
"mdast-util-to-markdown": "^2.2.0",
|
|
118
|
+
"micromark-extension-gfm-table": "^2.1.2",
|
|
104
119
|
"plur": "^6.0.0",
|
|
105
|
-
"pprof-format": "^2.3.
|
|
106
|
-
"pretty-bytes": "^7.
|
|
107
|
-
"pretty-ms": "^
|
|
108
|
-
"source-map-js": "^1.2.
|
|
120
|
+
"pprof-format": "^2.3.2",
|
|
121
|
+
"pretty-bytes": "^7.2.0",
|
|
122
|
+
"pretty-ms": "^10.0.0",
|
|
123
|
+
"source-map-js": "^1.2.2"
|
|
109
124
|
},
|
|
110
125
|
"devDependencies": {
|
|
111
|
-
"@fast-check/vitest": "^0.
|
|
112
|
-
"@
|
|
113
|
-
"@
|
|
114
|
-
"@
|
|
126
|
+
"@fast-check/vitest": "^0.5.0",
|
|
127
|
+
"@optique/man": "^1.3.6",
|
|
128
|
+
"@rollup/plugin-terser": "^1.0.2",
|
|
129
|
+
"@secretlint/core": "^13.0.7",
|
|
130
|
+
"@secretlint/secretlint-rule-preset-recommend": "^13.0.7",
|
|
131
|
+
"@tomer/eslint-config": "^6.0.0",
|
|
132
|
+
"@tomer/prettier-config": "^5.0.0",
|
|
115
133
|
"@types/convert-source-map": "^2.0.3",
|
|
116
134
|
"@types/mdast": "^4.0.4",
|
|
117
|
-
"@vitest/coverage-v8": "^
|
|
135
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
136
|
+
"cookie": "^2.0.1",
|
|
118
137
|
"dedent": "^1.7.2",
|
|
119
|
-
"eslint": "^10.
|
|
120
|
-
"
|
|
138
|
+
"eslint": "^10.13.0",
|
|
139
|
+
"ip-address": "^10.7.5",
|
|
140
|
+
"knip": "^6.43.0",
|
|
121
141
|
"mdast-util-gfm": "^3.1.0",
|
|
122
142
|
"micromark-extension-gfm": "^3.0.0",
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"publint": "^0.3.22",
|
|
143
|
+
"prettier": "^3.9.10",
|
|
144
|
+
"publint": "^0.3.25",
|
|
126
145
|
"rollup-plugin-tree-shakeable": "^2.0.0",
|
|
127
|
-
"tsdown": "^0.
|
|
146
|
+
"tsdown": "^0.23.2",
|
|
128
147
|
"typescript": "^6.0.3",
|
|
129
|
-
"vitest": "^
|
|
148
|
+
"vitest": "^5.0.5"
|
|
130
149
|
}
|
|
131
150
|
}
|