profiler-md 0.6.0 → 0.7.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 (239) hide show
  1. package/dist/cli/index.mjs +12685 -4219
  2. package/dist/index.d.mts +1140 -432
  3. package/dist/index.js +2 -2
  4. package/docs/api.md +138 -0
  5. package/docs/formats/callgrind.md +25 -0
  6. package/docs/formats/collapsed.md +5 -3
  7. package/docs/formats/ghc-eventlog.md +20 -0
  8. package/docs/formats/ghc-json-profile.md +23 -0
  9. package/docs/formats/hprof.md +21 -0
  10. package/docs/formats/jfr.md +2 -2
  11. package/docs/formats/jsc-heap-snapshot.md +10 -4
  12. package/docs/formats/memray.md +30 -0
  13. package/docs/formats/perf.md +74 -0
  14. package/docs/formats/pprof.md +4 -2
  15. package/docs/formats/speedscope.md +3 -2
  16. package/docs/formats/systing.md +17 -15
  17. package/docs/formats/v8-cpu-profile.md +4 -3
  18. package/docs/formats/v8-heap-profile.md +8 -5
  19. package/docs/formats/v8-heap-snapshot.md +8 -3
  20. package/docs/formats/webkit-timeline-recording.md +6 -0
  21. package/docs/languages/c.md +119 -32
  22. package/docs/languages/csharp.md +5 -3
  23. package/docs/languages/elixir.md +19 -11
  24. package/docs/languages/fortran.md +141 -0
  25. package/docs/languages/go.md +33 -10
  26. package/docs/languages/haskell.md +134 -0
  27. package/docs/languages/java.md +81 -26
  28. package/docs/languages/javascript.md +33 -27
  29. package/docs/languages/julia.md +21 -18
  30. package/docs/languages/php.md +7 -0
  31. package/docs/languages/python.md +105 -14
  32. package/docs/languages/ruby.md +15 -16
  33. package/docs/languages/rust.md +11 -10
  34. package/docs/languages/swift.md +135 -0
  35. package/docs/languages/zig.md +155 -0
  36. package/package.json +42 -42
  37. package/readme.md +301 -259
  38. package/skills/profile-optimize/SKILL.md +4 -2
  39. package/examples/output/c.gperftools.cpu.base.pprof.md +0 -324
  40. package/examples/output/c.gperftools.cpu.current.pprof.md +0 -271
  41. package/examples/output/c.gperftools.cpu.diff.pprof.md +0 -98
  42. package/examples/output/c.gperftools.heap.base.pprof.md +0 -362
  43. package/examples/output/c.gperftools.heap.current.pprof.md +0 -362
  44. package/examples/output/c.gperftools.heap.diff.pprof.md +0 -28
  45. package/examples/output/c.systing.cpu.base.systing.md +0 -824
  46. package/examples/output/c.systing.cpu.current.systing.md +0 -825
  47. package/examples/output/c.systing.cpu.diff.systing.md +0 -238
  48. package/examples/output/cpp.gperftools.cpu.base.pprof.md +0 -557
  49. package/examples/output/cpp.gperftools.cpu.current.pprof.md +0 -573
  50. package/examples/output/cpp.gperftools.cpu.diff.pprof.md +0 -122
  51. package/examples/output/cpp.gperftools.heap.base.pprof.md +0 -67
  52. package/examples/output/cpp.gperftools.heap.current.pprof.md +0 -67
  53. package/examples/output/cpp.gperftools.heap.diff.pprof.md +0 -19
  54. package/examples/output/csharp.dotnet-trace.base.speedscope.json.md +0 -411
  55. package/examples/output/csharp.dotnet-trace.current.speedscope.json.md +0 -412
  56. package/examples/output/csharp.dotnet-trace.diff.speedscope.json.md +0 -122
  57. package/examples/output/elixir.eflambe.cpu.base.collapsed.md +0 -399
  58. package/examples/output/elixir.eflambe.cpu.current.collapsed.md +0 -398
  59. package/examples/output/elixir.eflambe.cpu.diff.collapsed.md +0 -92
  60. package/examples/output/erlang.eflambe.cpu.base.collapsed.md +0 -147
  61. package/examples/output/erlang.eflambe.cpu.current.collapsed.md +0 -147
  62. package/examples/output/erlang.eflambe.cpu.diff.collapsed.md +0 -18
  63. package/examples/output/fsharp.dotnet-trace.base.speedscope.json.md +0 -324
  64. package/examples/output/fsharp.dotnet-trace.current.speedscope.json.md +0 -314
  65. package/examples/output/fsharp.dotnet-trace.diff.speedscope.json.md +0 -119
  66. package/examples/output/go.pprof.block.base.pprof.md +0 -86
  67. package/examples/output/go.pprof.block.current.pprof.md +0 -83
  68. package/examples/output/go.pprof.block.diff.pprof.md +0 -42
  69. package/examples/output/go.pprof.cpu.base.pprof.md +0 -81
  70. package/examples/output/go.pprof.cpu.current.pprof.md +0 -70
  71. package/examples/output/go.pprof.cpu.diff.pprof.md +0 -52
  72. package/examples/output/go.pprof.goroutine.base.pprof.md +0 -43
  73. package/examples/output/go.pprof.goroutine.current.pprof.md +0 -43
  74. package/examples/output/go.pprof.goroutine.diff.pprof.md +0 -13
  75. package/examples/output/go.pprof.heap-alloc.base.pprof.md +0 -154
  76. package/examples/output/go.pprof.heap-alloc.current.pprof.md +0 -146
  77. package/examples/output/go.pprof.heap-alloc.diff.pprof.md +0 -67
  78. package/examples/output/go.pprof.heap.base.pprof.md +0 -154
  79. package/examples/output/go.pprof.heap.current.pprof.md +0 -146
  80. package/examples/output/go.pprof.heap.diff.pprof.md +0 -67
  81. package/examples/output/go.pprof.mutex.base.pprof.md +0 -55
  82. package/examples/output/go.pprof.mutex.current.pprof.md +0 -41
  83. package/examples/output/go.pprof.mutex.diff.pprof.md +0 -31
  84. package/examples/output/go.pprof.threadcreate.base.pprof.md +0 -55
  85. package/examples/output/go.pprof.threadcreate.current.pprof.md +0 -55
  86. package/examples/output/go.pprof.threadcreate.diff.pprof.md +0 -19
  87. package/examples/output/java.async-profiler.all.base.jfr.md +0 -1071
  88. package/examples/output/java.async-profiler.all.current.jfr.md +0 -1007
  89. package/examples/output/java.async-profiler.all.diff.jfr.md +0 -268
  90. package/examples/output/java.async-profiler.alloc.base.jfr.md +0 -425
  91. package/examples/output/java.async-profiler.alloc.current.jfr.md +0 -413
  92. package/examples/output/java.async-profiler.alloc.diff.jfr.md +0 -99
  93. package/examples/output/java.async-profiler.cpu.base.collapsed.md +0 -367
  94. package/examples/output/java.async-profiler.cpu.base.jfr.md +0 -485
  95. package/examples/output/java.async-profiler.cpu.current.collapsed.md +0 -355
  96. package/examples/output/java.async-profiler.cpu.current.jfr.md +0 -488
  97. package/examples/output/java.async-profiler.cpu.diff.collapsed.md +0 -117
  98. package/examples/output/java.async-profiler.cpu.diff.jfr.md +0 -118
  99. package/examples/output/java.async-profiler.live.base.jfr.md +0 -697
  100. package/examples/output/java.async-profiler.live.current.jfr.md +0 -684
  101. package/examples/output/java.async-profiler.live.diff.jfr.md +0 -191
  102. package/examples/output/java.async-profiler.lock.base.jfr.md +0 -140
  103. package/examples/output/java.async-profiler.lock.current.jfr.md +0 -108
  104. package/examples/output/java.async-profiler.lock.diff.jfr.md +0 -44
  105. package/examples/output/java.async-profiler.nativemem.base.jfr.md +0 -222
  106. package/examples/output/java.async-profiler.nativemem.current.jfr.md +0 -222
  107. package/examples/output/java.async-profiler.nativemem.diff.jfr.md +0 -65
  108. package/examples/output/java.async-profiler.wall.base.jfr.md +0 -400
  109. package/examples/output/java.async-profiler.wall.current.jfr.md +0 -420
  110. package/examples/output/java.async-profiler.wall.diff.jfr.md +0 -94
  111. package/examples/output/java.jdk.all.base.jfr.md +0 -1024
  112. package/examples/output/java.jdk.all.current.jfr.md +0 -1010
  113. package/examples/output/java.jdk.all.diff.jfr.md +0 -311
  114. package/examples/output/java.jdk.alloc.base.jfr.md +0 -1024
  115. package/examples/output/java.jdk.alloc.current.jfr.md +0 -1046
  116. package/examples/output/java.jdk.alloc.diff.jfr.md +0 -312
  117. package/examples/output/java.jdk.cpu.base.jfr.md +0 -1023
  118. package/examples/output/java.jdk.cpu.current.jfr.md +0 -1039
  119. package/examples/output/java.jdk.cpu.diff.jfr.md +0 -285
  120. package/examples/output/java.jdk.live.base.jfr.md +0 -1029
  121. package/examples/output/java.jdk.live.current.jfr.md +0 -1035
  122. package/examples/output/java.jdk.live.diff.jfr.md +0 -289
  123. package/examples/output/java.jdk.lock.base.jfr.md +0 -1040
  124. package/examples/output/java.jdk.lock.current.jfr.md +0 -1051
  125. package/examples/output/java.jdk.lock.diff.jfr.md +0 -339
  126. package/examples/output/javascript.bun.base.cpuprofile.md +0 -73
  127. package/examples/output/javascript.bun.base.heapsnapshot.md +0 -608
  128. package/examples/output/javascript.bun.base.jsc-heap-snapshot.json.md +0 -480
  129. package/examples/output/javascript.bun.current.cpuprofile.md +0 -73
  130. package/examples/output/javascript.bun.current.heapsnapshot.md +0 -608
  131. package/examples/output/javascript.bun.current.jsc-heap-snapshot.json.md +0 -480
  132. package/examples/output/javascript.bun.diff.cpuprofile.md +0 -54
  133. package/examples/output/javascript.bun.diff.heapsnapshot.md +0 -48
  134. package/examples/output/javascript.bun.diff.jsc-heap-snapshot.json.md +0 -62
  135. package/examples/output/javascript.chrome.base.cpuprofile.md +0 -163
  136. package/examples/output/javascript.chrome.base.heapprofile.md +0 -32
  137. package/examples/output/javascript.chrome.base.heapsnapshot.md +0 -649
  138. package/examples/output/javascript.chrome.current.cpuprofile.md +0 -149
  139. package/examples/output/javascript.chrome.current.heapprofile.md +0 -32
  140. package/examples/output/javascript.chrome.current.heapsnapshot.md +0 -647
  141. package/examples/output/javascript.chrome.diff.cpuprofile.md +0 -65
  142. package/examples/output/javascript.chrome.diff.heapprofile.md +0 -50
  143. package/examples/output/javascript.chrome.diff.heapsnapshot.md +0 -73
  144. package/examples/output/javascript.deno.base.cpuprofile.md +0 -122
  145. package/examples/output/javascript.deno.current.cpuprofile.md +0 -114
  146. package/examples/output/javascript.deno.diff.cpuprofile.md +0 -66
  147. package/examples/output/javascript.node.base.cpuprofile.md +0 -136
  148. package/examples/output/javascript.node.base.heapprofile.md +0 -56
  149. package/examples/output/javascript.node.base.heapsnapshot.md +0 -660
  150. package/examples/output/javascript.node.current.cpuprofile.md +0 -119
  151. package/examples/output/javascript.node.current.heapprofile.md +0 -52
  152. package/examples/output/javascript.node.current.heapsnapshot.md +0 -660
  153. package/examples/output/javascript.node.diff.cpuprofile.md +0 -70
  154. package/examples/output/javascript.node.diff.heapprofile.md +0 -34
  155. package/examples/output/javascript.node.diff.heapsnapshot.md +0 -39
  156. package/examples/output/javascript.pprof.cpu.base.pprof.md +0 -104
  157. package/examples/output/javascript.pprof.cpu.current.pprof.md +0 -120
  158. package/examples/output/javascript.pprof.cpu.diff.pprof.md +0 -63
  159. package/examples/output/javascript.pprof.heap.base.pprof.md +0 -86
  160. package/examples/output/javascript.pprof.heap.current.pprof.md +0 -57
  161. package/examples/output/javascript.pprof.heap.diff.pprof.md +0 -42
  162. package/examples/output/javascript.safari.base.webkit-timeline-recording.json.md +0 -388
  163. package/examples/output/javascript.safari.current.webkit-timeline-recording.json.md +0 -378
  164. package/examples/output/javascript.safari.diff.webkit-timeline-recording.json.md +0 -122
  165. package/examples/output/julia.pprof-jl.alloc.base.pprof.md +0 -124
  166. package/examples/output/julia.pprof-jl.alloc.current.pprof.md +0 -126
  167. package/examples/output/julia.pprof-jl.alloc.diff.pprof.md +0 -30
  168. package/examples/output/julia.pprof-jl.cpu.base.pprof.md +0 -177
  169. package/examples/output/julia.pprof-jl.cpu.current.pprof.md +0 -179
  170. package/examples/output/julia.pprof-jl.cpu.diff.pprof.md +0 -64
  171. package/examples/output/julia.pprof-jl.wall.base.pprof.md +0 -181
  172. package/examples/output/julia.pprof-jl.wall.current.pprof.md +0 -193
  173. package/examples/output/julia.pprof-jl.wall.diff.pprof.md +0 -64
  174. package/examples/output/julia.profile.base.heapsnapshot.md +0 -590
  175. package/examples/output/julia.profile.current.heapsnapshot.md +0 -590
  176. package/examples/output/julia.profile.diff.heapsnapshot.md +0 -288
  177. package/examples/output/kotlin.async-profiler.all.base.jfr.md +0 -920
  178. package/examples/output/kotlin.async-profiler.all.current.jfr.md +0 -925
  179. package/examples/output/kotlin.async-profiler.all.diff.jfr.md +0 -247
  180. package/examples/output/kotlin.async-profiler.alloc.base.jfr.md +0 -467
  181. package/examples/output/kotlin.async-profiler.alloc.current.jfr.md +0 -473
  182. package/examples/output/kotlin.async-profiler.alloc.diff.jfr.md +0 -122
  183. package/examples/output/kotlin.async-profiler.cpu.base.collapsed.md +0 -371
  184. package/examples/output/kotlin.async-profiler.cpu.base.jfr.md +0 -472
  185. package/examples/output/kotlin.async-profiler.cpu.current.collapsed.md +0 -370
  186. package/examples/output/kotlin.async-profiler.cpu.current.jfr.md +0 -445
  187. package/examples/output/kotlin.async-profiler.cpu.diff.collapsed.md +0 -124
  188. package/examples/output/kotlin.async-profiler.cpu.diff.jfr.md +0 -125
  189. package/examples/output/kotlin.async-profiler.live.base.jfr.md +0 -934
  190. package/examples/output/kotlin.async-profiler.live.current.jfr.md +0 -917
  191. package/examples/output/kotlin.async-profiler.live.diff.jfr.md +0 -245
  192. package/examples/output/kotlin.async-profiler.lock.base.jfr.md +0 -1
  193. package/examples/output/kotlin.async-profiler.lock.current.jfr.md +0 -1
  194. package/examples/output/kotlin.async-profiler.lock.diff.jfr.md +0 -1
  195. package/examples/output/kotlin.async-profiler.nativemem.base.jfr.md +0 -234
  196. package/examples/output/kotlin.async-profiler.nativemem.current.jfr.md +0 -234
  197. package/examples/output/kotlin.async-profiler.nativemem.diff.jfr.md +0 -65
  198. package/examples/output/kotlin.async-profiler.wall.base.jfr.md +0 -452
  199. package/examples/output/kotlin.async-profiler.wall.current.jfr.md +0 -457
  200. package/examples/output/kotlin.async-profiler.wall.diff.jfr.md +0 -125
  201. package/examples/output/kotlin.jdk.all.base.jfr.md +0 -1442
  202. package/examples/output/kotlin.jdk.all.current.jfr.md +0 -1343
  203. package/examples/output/kotlin.jdk.all.diff.jfr.md +0 -392
  204. package/examples/output/kotlin.jdk.alloc.base.jfr.md +0 -1418
  205. package/examples/output/kotlin.jdk.alloc.current.jfr.md +0 -1389
  206. package/examples/output/kotlin.jdk.alloc.diff.jfr.md +0 -383
  207. package/examples/output/kotlin.jdk.cpu.base.jfr.md +0 -1406
  208. package/examples/output/kotlin.jdk.cpu.current.jfr.md +0 -1374
  209. package/examples/output/kotlin.jdk.cpu.diff.jfr.md +0 -380
  210. package/examples/output/kotlin.jdk.live.base.jfr.md +0 -1378
  211. package/examples/output/kotlin.jdk.live.current.jfr.md +0 -1311
  212. package/examples/output/kotlin.jdk.live.diff.jfr.md +0 -381
  213. package/examples/output/kotlin.jdk.lock.base.jfr.md +0 -1427
  214. package/examples/output/kotlin.jdk.lock.current.jfr.md +0 -1374
  215. package/examples/output/kotlin.jdk.lock.diff.jfr.md +0 -386
  216. package/examples/output/php.excimer.wall.base.speedscope.json.md +0 -25
  217. package/examples/output/php.excimer.wall.current.speedscope.json.md +0 -25
  218. package/examples/output/php.excimer.wall.diff.speedscope.json.md +0 -29
  219. package/examples/output/python.py-spy.cpu.base.collapsed.md +0 -526
  220. package/examples/output/python.py-spy.cpu.base.speedscope.json.md +0 -37
  221. package/examples/output/python.py-spy.cpu.current.collapsed.md +0 -514
  222. package/examples/output/python.py-spy.cpu.current.speedscope.json.md +0 -37
  223. package/examples/output/python.py-spy.cpu.diff.collapsed.md +0 -122
  224. package/examples/output/python.py-spy.cpu.diff.speedscope.json.md +0 -31
  225. package/examples/output/python.py-spy.wall.base.collapsed.md +0 -527
  226. package/examples/output/python.py-spy.wall.current.collapsed.md +0 -518
  227. package/examples/output/python.py-spy.wall.diff.collapsed.md +0 -122
  228. package/examples/output/ruby.rbspy.cpu.base.collapsed.md +0 -90
  229. package/examples/output/ruby.rbspy.cpu.base.pprof.md +0 -105
  230. package/examples/output/ruby.rbspy.cpu.base.speedscope.json.md +0 -105
  231. package/examples/output/ruby.rbspy.cpu.current.collapsed.md +0 -90
  232. package/examples/output/ruby.rbspy.cpu.current.pprof.md +0 -115
  233. package/examples/output/ruby.rbspy.cpu.current.speedscope.json.md +0 -115
  234. package/examples/output/ruby.rbspy.cpu.diff.collapsed.md +0 -32
  235. package/examples/output/ruby.rbspy.cpu.diff.pprof.md +0 -44
  236. package/examples/output/ruby.rbspy.cpu.diff.speedscope.json.md +0 -44
  237. package/examples/output/rust.pprof-rs.cpu.base.pprof.md +0 -60
  238. package/examples/output/rust.pprof-rs.cpu.current.pprof.md +0 -60
  239. package/examples/output/rust.pprof-rs.cpu.diff.pprof.md +0 -24
package/readme.md CHANGED
@@ -1,3 +1,7 @@
1
+ <div align="center">
2
+ <img src="assets/logo.svg" alt="Markdown flame logo" width="250" />
3
+ </div>
4
+
1
5
  <h1 align="center">
2
6
  profiler-md
3
7
  </h1>
@@ -18,52 +22,258 @@
18
22
  Converts performance profiles to human and LLM friendly Markdown.
19
23
  </div>
20
24
 
25
+ <div align="center">
26
+ <a href="#demo">Demo</a> •
27
+ <a href="#features">Features</a> •
28
+ <a href="#install">Install</a> •
29
+ <a href="#usage">Usage</a> •
30
+ <a href="#skill">Skill</a> •
31
+ <a href="#languages-and-formats">Languages and formats</a>
32
+ </div>
33
+
21
34
  > [!NOTE]
22
35
  >
23
- > This package is in **beta** and I'm excited for you to try it!
24
- >
25
- > I'd love your feedback! Share suggestions, bug reports, feature requests, or
26
- > other thoughts by
36
+ > This package is in **beta** and I'm excited for you to try it! Share
37
+ > suggestions, bug reports, and feature requests by
27
38
  > [filing an issue](https://github.com/TomerAberbach/profiler-md/issues/new).
28
39
 
40
+ ## Demo
41
+
42
+ <div align="center">
43
+ <img src="assets/demo.gif" alt="Converting and diffing CPU profiles in the terminal" />
44
+ </div>
45
+
46
+ <!-- prettier-ignore-start -->
47
+
48
+ <!-- EXAMPLE_OUTPUT START -->
49
+
50
+ ```md
51
+ # CPU profile
52
+
53
+ Took 2.49s over 2,659 samples (939.9µs per sample).
54
+
55
+ | Category | % | Time | Samples |
56
+ | ------------------ | ----: | ------: | ------: |
57
+ | Third-party | 87.4% | 2.18s | 2,410 |
58
+ | Garbage collector | 7.6% | 191.0ms | 156 |
59
+ | Standard library | 3.9% | 96.8ms | 70 |
60
+ | Native | 0.9% | 22.7ms | 20 |
61
+ | Regular expression | 0.1% | 2.5ms | 2 |
62
+ | Ours | 0.1% | 1.3ms | 1 |
63
+
64
+ ## Hottest functions
65
+
66
+ ### Self time
67
+
68
+ Functions ranked by time spent directly in the function body, excluding callees.
69
+
70
+ | % | Time | Samples | Function | Location |
71
+ | ---: | ------: | ------: | ------------------------------- | ---------------------------------------------------- |
72
+ | 7.6% | 191.0ms | 156 | `(garbage collector)` | `<unknown>` |
73
+ | 2.9% | 71.5ms | 57 | `wrapSafe` | `node:internal/modules/cjs/loader:1671:18` |
74
+ | 2.8% | 69.0ms | 66 | `recursiveTypeRelatedTo` | `node_modules/typescript/lib/typescript.js:64383:38` |
75
+ | 2.5% | 63.0ms | 66 | `isRelatedTo` | `node_modules/typescript/lib/typescript.js:63813:27` |
76
+ | 2.1% | 51.7ms | 43 | `checkTypeRelatedTo` | `node_modules/typescript/lib/typescript.js:63505:32` |
77
+ …
78
+ ```
79
+
80
+ <!-- EXAMPLE_OUTPUT END -->
81
+
82
+ <!-- prettier-ignore-end -->
83
+
84
+ The output continues with the hottest functions by total time, the hottest call
85
+ stacks, and per-line, caller, and callee detail. See the
86
+ [full output](examples/output/javascript.node.base.cpuprofile.md), or
87
+ [`examples/output/`](examples/output) for heap snapshots and diffs.
88
+
29
89
  ## Features
30
90
 
31
- - **Polyglot:** supports many profile and heap snapshot formats across many
32
- languages
33
- - **Profile analysis:** summarizes sampling rates and category breakdowns, ranks
34
- the hottest functions by self and total time (or allocations, locks, or
35
- whatever else was sampled) with per-line, caller, and callee breakdowns, and
36
- lists the hottest call stacks
37
- - **Heap analysis:** reports self and retained size with
91
+ - **Polyglot:**
92
+ [profile, call graph, and heap snapshot formats](#languages-and-formats)
93
+ across many languages
94
+ - **Profile analysis:** sampling rates, category breakdowns, and the hottest
95
+ functions, call stacks, lines, callers, and callees
96
+ - **Heap analysis:** self and
38
97
  [dominator](<https://en.wikipedia.org/wiki/Dominator_(graph_theory)>)-based
39
- retention, retainer paths, and the largest constructors, closures, and strings
40
- - **Diffing:** compare two profiles or two heap snapshots to see ranked
41
- regressions and improvements, with entry matching that ignores run-varying
42
- identifiers like build hashes
98
+ retained sizes, retainer paths, and the largest constructors and strings
99
+ - **Multi-profile inputs:** one `all` JFR recording becomes CPU, allocation, and
100
+ lock contention profiles
101
+ - **Diffing:** ranked regressions and improvements between two profiles or two
102
+ heap snapshots, across formats and profilers
43
103
  - **Source maps:** resolves minified and transpiled locations back to original
44
- sources, from standalone or inline source maps
45
- - **Zero config:** auto-detects the format and the profiler and runtime that
46
- produced it, decompresses gzip/brotli, and reads from stdin
47
- - **Fast:** parses and detects formats while streaming the input, and uses
48
- specialized data structures so large profiles and snapshots convert quickly
49
- - **Configurable:** control the number of top entries shown, the base URL or
50
- directory that locations are shown relative to, entry categorization and
51
- third-party detection, entry filtering, and diff matching; the defaults are
52
- exported for custom hooks to build on
53
- - **CLI and API:** use it from the command line or programmatically via a
54
- fully-typed API with sync and async variants
55
- - **Readable in the terminal:** ANSI syntax highlighting with heat-map coloring
56
- and automatic paging
104
+ sources
105
+ - **Zero config:** auto-detects the format and profiler
106
+ - **Configurable:** top entry counts, base URLs, categorization, filtering, and
107
+ diff matching
108
+ - **CLI and API:** a command line and a fully-typed API with sync and async
109
+ variants ([API docs](docs/api.md))
57
110
  - **Self-documenting:** `--help <language>` and `--help <format>` explain how to
58
- generate and understand each profile type, and shell completions cover bash,
59
- fish, zsh, and PowerShell
60
- - **Agent-ready:** ships a [skill](./skills/profile-optimize/SKILL.md) that
61
- guides an agent through profiling and optimizing your code
111
+ generate and read each profile type
112
+ - **Agent-ready:** ships a [skill](#skill) that guides an agent through
113
+ profiling and optimizing your code
114
+
115
+ ## Install
116
+
117
+ ```sh
118
+ # npm
119
+ $ npm i -g profiler-md
120
+
121
+ # Homebrew
122
+ $ brew install tomeraberbach/tap/profiler-md
123
+ ```
124
+
125
+ <details>
126
+ <summary>Shell completions (optional)</summary>
127
+
128
+ ```sh
129
+ # Bash (Linux)
130
+ $ profiler-md --completion bash > ~/.local/share/bash-completion/completions/profiler-md
131
+
132
+ # Bash (macOS/Homebrew)
133
+ $ profiler-md --completion bash > $(brew --prefix)/etc/bash_completion.d/profiler-md
134
+
135
+ # Fish
136
+ $ profiler-md --completion fish > ~/.config/fish/completions/profiler-md.fish
137
+
138
+ # Zsh
139
+ $ profiler-md --completion zsh > ~/.zfunc/_profiler-md
140
+
141
+ # PowerShell
142
+ $ profiler-md --completion pwsh >> $PROFILE.CurrentUserCurrentHost
143
+ ```
144
+
145
+ </details>
146
+
147
+ ## Usage
148
+
149
+ ### CLI
150
+
151
+ ```sh
152
+ # Convert a profile, paged and syntax highlighted
153
+ $ profiler-md profile.cpuprofile
154
+
155
+ # Diff two profiles or two heap snapshots
156
+ $ profiler-md base.cpuprofile current.cpuprofile
157
+
158
+ # Write the Markdown to a file
159
+ $ profiler-md profile.pb.gz -o profile.md
160
+
161
+ # Read a profile from stdin
162
+ $ node --cpu-prof app.js && cat *.cpuprofile | profiler-md
163
+ ```
164
+
165
+ <details>
166
+ <summary>All flags</summary>
167
+
168
+ <!-- prettier-ignore-start -->
169
+
170
+ <!-- CLI_HELP START -->
171
+
172
+ ```sh
173
+ $ profiler-md --help
174
+ Usage: profiler-md [(-h/--help [TOPIC])] [-f/--format FORMAT] [-r/--origin
175
+ ORIGIN] [-o/--output FILE] [--top-n N] [--min-category-share FRACTION] [
176
+ --base-url STRING] [--source-maps GLOB...] [--match-name
177
+ REGEX=REPLACEMENT...] [--match-location REGEX=REPLACEMENT...] [--category
178
+ REGEX=CATEGORY...] [--hide REGEX...] [--show REGEX...] [--hide-category
179
+ CATEGORY...] [--show-category CATEGORY...] [--no-pager] [--color/
180
+ --no-color] ([FILE] | BASE CURRENT)
181
+
182
+ Converts performance profiles to human and LLM friendly Markdown.
183
+
184
+ -h, --help [TOPIC] Show this help message or topic docs
185
+ -f, --format FORMAT Input profile format (default: auto)
186
+ -r, --origin ORIGIN Input profile origin (default: auto)
187
+ -o, --output FILE Output file (default: - for stdout)
188
+ --top-n N Entries to show per ranking, including
189
+ category subsections (default: 20)
190
+ --min-category-share FRACTION Share of a profile a category needs for
191
+ its own subsection, from 0 to 1 (default:
192
+ 0.01)
193
+ --base-url STRING Base URL or path to show paths relative
194
+ to, or "auto" for their common ancestor
195
+ (default: cwd)
196
+ --source-maps GLOB Source maps (JSON or inline) to apply to
197
+ locations (repeatable)
198
+ --match-name REGEX=REPLACEMENT Rewrite names matching REGEX to
199
+ REPLACEMENT when pairing diffed entries
200
+ (repeatable)
201
+ --match-location REGEX=REPLACEMENT Rewrite locations (URL, path, or logical
202
+ name) matching REGEX to REPLACEMENT when
203
+ pairing diffed entries (repeatable)
204
+ --category REGEX=CATEGORY Categorize functions whose name or
205
+ location matches REGEX as CATEGORY, first
206
+ rule winning (repeatable)
207
+ --hide REGEX Hide entries whose name or location
208
+ matches REGEX, still counting hidden
209
+ entries in totals (repeatable)
210
+ --show REGEX Show only entries whose name or location
211
+ matches REGEX, still counting hidden
212
+ entries in totals (repeatable)
213
+ --hide-category CATEGORY Hide entries of CATEGORY, still counting
214
+ hidden entries in totals (repeatable)
215
+ --show-category CATEGORY Show only entries of CATEGORY, still
216
+ counting hidden entries in totals
217
+ (repeatable)
218
+ --no-pager Disable stdout paging (default: auto)
219
+ --color, --no-color Enable or disable ANSI syntax
220
+ highlighting (default: auto)
221
+ FILE Profile to convert (default: stdin)
222
+ BASE Base profile to diff
223
+ CURRENT Current profile to diff against the base
224
+
225
+ Formats: callgrind, collapsed, ghc-eventlog, ghc-json-profile, hprof, jfr, jsc-heap-snapshot, memray, perf, pprof, speedscope, systing, v8-cpu-profile, v8-heap-profile, v8-heap-snapshot, webkit-timeline-recording
226
+ Origins: async-profiler, bun, chrome, deno, dotnet-trace, eflambe, excimer, ghc, go, gperftools, jdk, memray, node, node-pprof, perf, pprof-jl, pprof-rs, profile-jl, py-spy, pyinstrument, rbspy, safari, simpleperf, systing, tachyon, unknown, valgrind
227
+ Function categories (--category, --hide-category, --show-category): ours, third-party, stdlib, native, unknown, garbage collector, compiler, jit, regexp, kernel, idle
228
+ Heap snapshot categories (--hide-category, --show-category): object, array, string, concatenated string, sliced string, function, code, regexp, number, big number, symbol, native, object shape, internal, synthetic, unknown
229
+ Languages: c/cpp, csharp/fsharp, elixir/erlang, fortran, go, haskell, java/kotlin/groovy, javascript/typescript, julia, php, python, ruby, rust, swift, zig
230
+ ```
231
+
232
+ <!-- CLI_HELP END -->
233
+
234
+ <!-- prettier-ignore-end -->
235
+
236
+ </details>
237
+
238
+ ### API
239
+
240
+ ```js
241
+ import { openAsBlob } from 'node:fs'
242
+ import { diffProfilesAsync, profileToMdAsync } from 'profiler-md'
243
+
244
+ // Convert a profile or heap snapshot. The format and origin are auto-detected
245
+ console.log(await profileToMdAsync(await openAsBlob(`example.cpuprofile`)))
246
+
247
+ // Diff two profiles or two heap snapshots
248
+ console.log(
249
+ await diffProfilesAsync(
250
+ await openAsBlob(`base.cpuprofile`),
251
+ await openAsBlob(`current.cpuprofile`),
252
+ ),
253
+ )
254
+ ```
255
+
256
+ See the [API docs](docs/api.md) for sync variants, explicit formats and origins,
257
+ and configuration callbacks.
258
+
259
+ ## Skill
260
+
261
+ Use the [`profiler-md` skill](./skills/profile-optimize/SKILL.md) to have an
262
+ agent profile and optimize your code:
263
+
264
+ ```sh
265
+ $ npx skills add TomerAberbach/profiler-md --skill profile-optimize
266
+ ```
267
+
268
+ See [skills.sh](https://skills.sh/docs) for more info.
269
+
270
+ Fun fact: the skill has profiled and optimized `profiler-md` itself!
62
271
 
63
272
  ## Languages and formats
64
273
 
65
- We list a format for a language only if its ecosystem's tools natively generate
66
- it. Third-party tools can often convert others, though.
274
+ The table lists only the formats each language's own tools generate. Third-party
275
+ tools convert others. Each format's [docs](docs/formats) explain how to generate
276
+ and read it.
67
277
 
68
278
  <!-- prettier-ignore-start -->
69
279
 
@@ -77,80 +287,111 @@ it. Third-party tools can often convert others, though.
77
287
  <tr>
78
288
  <td><a href="docs/languages/c.md">C⁠/⁠C++</a></td>
79
289
  <td>
80
- <div><a href="docs/formats/pprof.md">pprof</a>:<ul><li>C CPU (<a href="examples/output/c.gperftools.cpu.base.pprof.md">base</a>, <a href="examples/output/c.gperftools.cpu.current.pprof.md">current</a>, <a href="examples/output/c.gperftools.cpu.diff.pprof.md">diff</a>)</li><li>C Heap (<a href="examples/output/c.gperftools.heap.base.pprof.md">base</a>, <a href="examples/output/c.gperftools.heap.current.pprof.md">current</a>, <a href="examples/output/c.gperftools.heap.diff.pprof.md">diff</a>)</li><li>C++ CPU (<a href="examples/output/cpp.gperftools.cpu.base.pprof.md">base</a>, <a href="examples/output/cpp.gperftools.cpu.current.pprof.md">current</a>, <a href="examples/output/cpp.gperftools.cpu.diff.pprof.md">diff</a>)</li><li>C++ Heap (<a href="examples/output/cpp.gperftools.heap.base.pprof.md">base</a>, <a href="examples/output/cpp.gperftools.heap.current.pprof.md">current</a>, <a href="examples/output/cpp.gperftools.heap.diff.pprof.md">diff</a>)</li></ul></div>
81
- <div><a href="docs/formats/systing.md">systing profile export</a>: <a href="examples/output/c.systing.cpu.base.systing.md">base</a>, <a href="examples/output/c.systing.cpu.current.systing.md">current</a>, <a href="examples/output/c.systing.cpu.diff.systing.md">diff</a></div>
290
+ <details><summary><a href="docs/formats/callgrind.md">Callgrind</a></summary><ul><li>C Valgrind (<a href="examples/output/c.valgrind.base.callgrind.md">base</a>, <a href="examples/output/c.valgrind.current.callgrind.md">current</a>, <a href="examples/output/c.valgrind.diff.callgrind.md">diff</a>)</li></ul></details>
291
+ <details><summary><a href="docs/formats/perf.md">perf.data</a></summary><ul><li>C perf CPU (<a href="examples/output/c.perf.cpu.base.perf.data.md">base</a>, <a href="examples/output/c.perf.cpu.current.perf.data.md">current</a>, <a href="examples/output/c.perf.cpu.diff.perf.data.md">diff</a>)</li><li>C++ perf CPU (<a href="examples/output/cpp.perf.cpu.base.perf.data.md">base</a>, <a href="examples/output/cpp.perf.cpu.current.perf.data.md">current</a>, <a href="examples/output/cpp.perf.cpu.diff.perf.data.md">diff</a>)</li></ul></details>
292
+ <details><summary><a href="docs/formats/pprof.md">pprof</a></summary><ul><li>C gperftools CPU (<a href="examples/output/c.gperftools.cpu.base.pprof.md">base</a>, <a href="examples/output/c.gperftools.cpu.current.pprof.md">current</a>, <a href="examples/output/c.gperftools.cpu.diff.pprof.md">diff</a>)</li><li>C gperftools heap (<a href="examples/output/c.gperftools.heap.base.pprof.md">base</a>, <a href="examples/output/c.gperftools.heap.current.pprof.md">current</a>, <a href="examples/output/c.gperftools.heap.diff.pprof.md">diff</a>)</li><li>C++ gperftools CPU (<a href="examples/output/cpp.gperftools.cpu.base.pprof.md">base</a>, <a href="examples/output/cpp.gperftools.cpu.current.pprof.md">current</a>, <a href="examples/output/cpp.gperftools.cpu.diff.pprof.md">diff</a>)</li><li>C++ gperftools heap (<a href="examples/output/cpp.gperftools.heap.base.pprof.md">base</a>, <a href="examples/output/cpp.gperftools.heap.current.pprof.md">current</a>, <a href="examples/output/cpp.gperftools.heap.diff.pprof.md">diff</a>)</li></ul></details>
293
+ <details><summary><a href="docs/formats/systing.md">systing</a></summary><ul><li>C systing CPU (<a href="examples/output/c.systing.cpu.base.systing.md">base</a>, <a href="examples/output/c.systing.cpu.current.systing.md">current</a>, <a href="examples/output/c.systing.cpu.diff.systing.md">diff</a>)</li></ul></details>
82
294
  </td>
83
295
  </tr>
84
296
  <tr>
85
297
  <td><a href="docs/languages/csharp.md">C#⁠/⁠F#</a></td>
86
298
  <td>
87
- <div><a href="docs/formats/speedscope.md">Speedscope</a>:<ul><li>C# (<a href="examples/output/csharp.dotnet-trace.base.speedscope.json.md">base</a>, <a href="examples/output/csharp.dotnet-trace.current.speedscope.json.md">current</a>, <a href="examples/output/csharp.dotnet-trace.diff.speedscope.json.md">diff</a>)</li><li>F# (<a href="examples/output/fsharp.dotnet-trace.base.speedscope.json.md">base</a>, <a href="examples/output/fsharp.dotnet-trace.current.speedscope.json.md">current</a>, <a href="examples/output/fsharp.dotnet-trace.diff.speedscope.json.md">diff</a>)</li></ul></div>
299
+ <details><summary><a href="docs/formats/speedscope.md">Speedscope</a></summary><ul><li>C# dotnet-trace (<a href="examples/output/csharp.dotnet-trace.base.speedscope.json.md">base</a>, <a href="examples/output/csharp.dotnet-trace.current.speedscope.json.md">current</a>, <a href="examples/output/csharp.dotnet-trace.diff.speedscope.json.md">diff</a>)</li><li>F# dotnet-trace (<a href="examples/output/fsharp.dotnet-trace.base.speedscope.json.md">base</a>, <a href="examples/output/fsharp.dotnet-trace.current.speedscope.json.md">current</a>, <a href="examples/output/fsharp.dotnet-trace.diff.speedscope.json.md">diff</a>)</li></ul></details>
88
300
  </td>
89
301
  </tr>
90
302
  <tr>
91
303
  <td><a href="docs/languages/elixir.md">Elixir⁠/⁠Erlang</a></td>
92
304
  <td>
93
- <div><a href="docs/formats/collapsed.md">Collapsed stacks</a>:<ul><li>Elixir (<a href="examples/output/elixir.eflambe.cpu.base.collapsed.md">base</a>, <a href="examples/output/elixir.eflambe.cpu.current.collapsed.md">current</a>, <a href="examples/output/elixir.eflambe.cpu.diff.collapsed.md">diff</a>)</li><li>Erlang (<a href="examples/output/erlang.eflambe.cpu.base.collapsed.md">base</a>, <a href="examples/output/erlang.eflambe.cpu.current.collapsed.md">current</a>, <a href="examples/output/erlang.eflambe.cpu.diff.collapsed.md">diff</a>)</li></ul></div>
305
+ <details><summary><a href="docs/formats/collapsed.md">Collapsed stacks</a></summary><ul><li>Elixir eflambe wall (<a href="examples/output/elixir.eflambe.wall.base.collapsed.md">base</a>, <a href="examples/output/elixir.eflambe.wall.current.collapsed.md">current</a>, <a href="examples/output/elixir.eflambe.wall.diff.collapsed.md">diff</a>)</li><li>Erlang eflambe wall (<a href="examples/output/erlang.eflambe.wall.base.collapsed.md">base</a>, <a href="examples/output/erlang.eflambe.wall.current.collapsed.md">current</a>, <a href="examples/output/erlang.eflambe.wall.diff.collapsed.md">diff</a>)</li></ul></details>
306
+ </td>
307
+ </tr>
308
+ <tr>
309
+ <td><a href="docs/languages/fortran.md">Fortran</a></td>
310
+ <td>
311
+ <details><summary><a href="docs/formats/pprof.md">pprof</a></summary><ul><li>Fortran gperftools CPU (<a href="examples/output/fortran.gperftools.cpu.base.pprof.md">base</a>, <a href="examples/output/fortran.gperftools.cpu.current.pprof.md">current</a>, <a href="examples/output/fortran.gperftools.cpu.diff.pprof.md">diff</a>)</li><li>Fortran gperftools heap (<a href="examples/output/fortran.gperftools.heap.base.pprof.md">base</a>, <a href="examples/output/fortran.gperftools.heap.current.pprof.md">current</a>, <a href="examples/output/fortran.gperftools.heap.diff.pprof.md">diff</a>)</li></ul></details>
94
312
  </td>
95
313
  </tr>
96
314
  <tr>
97
315
  <td><a href="docs/languages/go.md">Go</a></td>
98
316
  <td>
99
- <div><a href="docs/formats/pprof.md">pprof</a>:<ul><li>Block (<a href="examples/output/go.pprof.block.base.pprof.md">base</a>, <a href="examples/output/go.pprof.block.current.pprof.md">current</a>, <a href="examples/output/go.pprof.block.diff.pprof.md">diff</a>)</li><li>CPU (<a href="examples/output/go.pprof.cpu.base.pprof.md">base</a>, <a href="examples/output/go.pprof.cpu.current.pprof.md">current</a>, <a href="examples/output/go.pprof.cpu.diff.pprof.md">diff</a>)</li><li>Goroutine (<a href="examples/output/go.pprof.goroutine.base.pprof.md">base</a>, <a href="examples/output/go.pprof.goroutine.current.pprof.md">current</a>, <a href="examples/output/go.pprof.goroutine.diff.pprof.md">diff</a>)</li><li>Heap (<a href="examples/output/go.pprof.heap.base.pprof.md">base</a>, <a href="examples/output/go.pprof.heap.current.pprof.md">current</a>, <a href="examples/output/go.pprof.heap.diff.pprof.md">diff</a>)</li><li>Heap allocations (<a href="examples/output/go.pprof.heap-alloc.base.pprof.md">base</a>, <a href="examples/output/go.pprof.heap-alloc.current.pprof.md">current</a>, <a href="examples/output/go.pprof.heap-alloc.diff.pprof.md">diff</a>)</li><li>Mutex (<a href="examples/output/go.pprof.mutex.base.pprof.md">base</a>, <a href="examples/output/go.pprof.mutex.current.pprof.md">current</a>, <a href="examples/output/go.pprof.mutex.diff.pprof.md">diff</a>)</li><li>Thread creation (<a href="examples/output/go.pprof.threadcreate.base.pprof.md">base</a>, <a href="examples/output/go.pprof.threadcreate.current.pprof.md">current</a>, <a href="examples/output/go.pprof.threadcreate.diff.pprof.md">diff</a>)</li></ul></div>
317
+ <details><summary><a href="docs/formats/pprof.md">pprof</a></summary><ul><li>Go pprof block (<a href="examples/output/go.go.block.base.pprof.md">base</a>, <a href="examples/output/go.go.block.current.pprof.md">current</a>, <a href="examples/output/go.go.block.diff.pprof.md">diff</a>)</li><li>Go pprof CPU (<a href="examples/output/go.go.cpu.base.pprof.md">base</a>, <a href="examples/output/go.go.cpu.current.pprof.md">current</a>, <a href="examples/output/go.go.cpu.diff.pprof.md">diff</a>)</li><li>Go pprof goroutine (<a href="examples/output/go.go.goroutine.base.pprof.md">base</a>, <a href="examples/output/go.go.goroutine.current.pprof.md">current</a>, <a href="examples/output/go.go.goroutine.diff.pprof.md">diff</a>)</li><li>Go pprof goroutine leak (<a href="examples/output/go.go.goroutineleak.base.pprof.md">base</a>, <a href="examples/output/go.go.goroutineleak.current.pprof.md">current</a>, <a href="examples/output/go.go.goroutineleak.diff.pprof.md">diff</a>)</li><li>Go pprof heap (<a href="examples/output/go.go.heap.base.pprof.md">base</a>, <a href="examples/output/go.go.heap.current.pprof.md">current</a>, <a href="examples/output/go.go.heap.diff.pprof.md">diff</a>)</li><li>Go pprof heap-alloc (<a href="examples/output/go.go.heap-alloc.base.pprof.md">base</a>, <a href="examples/output/go.go.heap-alloc.current.pprof.md">current</a>, <a href="examples/output/go.go.heap-alloc.diff.pprof.md">diff</a>)</li><li>Go pprof mutex (<a href="examples/output/go.go.mutex.base.pprof.md">base</a>, <a href="examples/output/go.go.mutex.current.pprof.md">current</a>, <a href="examples/output/go.go.mutex.diff.pprof.md">diff</a>)</li><li>Go pprof threadcreate (<a href="examples/output/go.go.threadcreate.base.pprof.md">base</a>, <a href="examples/output/go.go.threadcreate.current.pprof.md">current</a>, <a href="examples/output/go.go.threadcreate.diff.pprof.md">diff</a>)</li></ul></details>
100
318
  </td>
101
319
  </tr>
102
320
  <tr>
103
- <td><a href="docs/languages/java.md">Java⁠/⁠Kotlin</a></td>
321
+ <td><a href="docs/languages/haskell.md">Haskell</a></td>
104
322
  <td>
105
- <div><a href="docs/formats/collapsed.md">Collapsed stacks</a>:<ul><li>Java (<a href="examples/output/java.async-profiler.cpu.base.collapsed.md">base</a>, <a href="examples/output/java.async-profiler.cpu.current.collapsed.md">current</a>, <a href="examples/output/java.async-profiler.cpu.diff.collapsed.md">diff</a>)</li><li>Kotlin (<a href="examples/output/kotlin.async-profiler.cpu.base.collapsed.md">base</a>, <a href="examples/output/kotlin.async-profiler.cpu.current.collapsed.md">current</a>, <a href="examples/output/kotlin.async-profiler.cpu.diff.collapsed.md">diff</a>)</li></ul></div>
106
- <div><a href="docs/formats/jfr.md">JFR</a>:<ul><li>Java async-profiler All (<a href="examples/output/java.async-profiler.all.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.all.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.all.diff.jfr.md">diff</a>)</li><li>Java async-profiler Allocations (<a href="examples/output/java.async-profiler.alloc.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.alloc.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.alloc.diff.jfr.md">diff</a>)</li><li>Java async-profiler CPU (<a href="examples/output/java.async-profiler.cpu.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.cpu.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.cpu.diff.jfr.md">diff</a>)</li><li>Java async-profiler Live (<a href="examples/output/java.async-profiler.live.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.live.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.live.diff.jfr.md">diff</a>)</li><li>Java async-profiler Lock (<a href="examples/output/java.async-profiler.lock.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.lock.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.lock.diff.jfr.md">diff</a>)</li><li>Java async-profiler Native memory (<a href="examples/output/java.async-profiler.nativemem.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.nativemem.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.nativemem.diff.jfr.md">diff</a>)</li><li>Java async-profiler Wall (<a href="examples/output/java.async-profiler.wall.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.wall.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.wall.diff.jfr.md">diff</a>)</li><li>Java JDK All (<a href="examples/output/java.jdk.all.base.jfr.md">base</a>, <a href="examples/output/java.jdk.all.current.jfr.md">current</a>, <a href="examples/output/java.jdk.all.diff.jfr.md">diff</a>)</li><li>Java JDK Allocations (<a href="examples/output/java.jdk.alloc.base.jfr.md">base</a>, <a href="examples/output/java.jdk.alloc.current.jfr.md">current</a>, <a href="examples/output/java.jdk.alloc.diff.jfr.md">diff</a>)</li><li>Java JDK CPU (<a href="examples/output/java.jdk.cpu.base.jfr.md">base</a>, <a href="examples/output/java.jdk.cpu.current.jfr.md">current</a>, <a href="examples/output/java.jdk.cpu.diff.jfr.md">diff</a>)</li><li>Java JDK Live (<a href="examples/output/java.jdk.live.base.jfr.md">base</a>, <a href="examples/output/java.jdk.live.current.jfr.md">current</a>, <a href="examples/output/java.jdk.live.diff.jfr.md">diff</a>)</li><li>Java JDK Lock (<a href="examples/output/java.jdk.lock.base.jfr.md">base</a>, <a href="examples/output/java.jdk.lock.current.jfr.md">current</a>, <a href="examples/output/java.jdk.lock.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler All (<a href="examples/output/kotlin.async-profiler.all.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.all.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.all.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler Allocations (<a href="examples/output/kotlin.async-profiler.alloc.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.alloc.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.alloc.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler CPU (<a href="examples/output/kotlin.async-profiler.cpu.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.cpu.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.cpu.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler Live (<a href="examples/output/kotlin.async-profiler.live.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.live.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.live.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler Lock (<a href="examples/output/kotlin.async-profiler.lock.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.lock.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.lock.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler Native memory (<a href="examples/output/kotlin.async-profiler.nativemem.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.nativemem.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.nativemem.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler Wall (<a href="examples/output/kotlin.async-profiler.wall.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.wall.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.wall.diff.jfr.md">diff</a>)</li><li>Kotlin JDK All (<a href="examples/output/kotlin.jdk.all.base.jfr.md">base</a>, <a href="examples/output/kotlin.jdk.all.current.jfr.md">current</a>, <a href="examples/output/kotlin.jdk.all.diff.jfr.md">diff</a>)</li><li>Kotlin JDK Allocations (<a href="examples/output/kotlin.jdk.alloc.base.jfr.md">base</a>, <a href="examples/output/kotlin.jdk.alloc.current.jfr.md">current</a>, <a href="examples/output/kotlin.jdk.alloc.diff.jfr.md">diff</a>)</li><li>Kotlin JDK CPU (<a href="examples/output/kotlin.jdk.cpu.base.jfr.md">base</a>, <a href="examples/output/kotlin.jdk.cpu.current.jfr.md">current</a>, <a href="examples/output/kotlin.jdk.cpu.diff.jfr.md">diff</a>)</li><li>Kotlin JDK Live (<a href="examples/output/kotlin.jdk.live.base.jfr.md">base</a>, <a href="examples/output/kotlin.jdk.live.current.jfr.md">current</a>, <a href="examples/output/kotlin.jdk.live.diff.jfr.md">diff</a>)</li><li>Kotlin JDK Lock (<a href="examples/output/kotlin.jdk.lock.base.jfr.md">base</a>, <a href="examples/output/kotlin.jdk.lock.current.jfr.md">current</a>, <a href="examples/output/kotlin.jdk.lock.diff.jfr.md">diff</a>)</li></ul></div>
323
+ <details><summary><a href="docs/formats/ghc-eventlog.md">GHC eventlog</a></summary><ul><li>Haskell GHC (<a href="examples/output/haskell.ghc.base.eventlog.md">base</a>, <a href="examples/output/haskell.ghc.current.eventlog.md">current</a>, <a href="examples/output/haskell.ghc.diff.eventlog.md">diff</a>)</li></ul></details>
324
+ <details><summary><a href="docs/formats/ghc-json-profile.md">GHC JSON profile</a></summary><ul><li>Haskell GHC (<a href="examples/output/haskell.ghc.base.prof.json.md">base</a>, <a href="examples/output/haskell.ghc.current.prof.json.md">current</a>, <a href="examples/output/haskell.ghc.diff.prof.json.md">diff</a>)</li></ul></details>
325
+ </td>
326
+ </tr>
327
+ <tr>
328
+ <td><a href="docs/languages/java.md">Java⁠/⁠Kotlin⁠/⁠Groovy</a></td>
329
+ <td>
330
+ <details><summary><a href="docs/formats/collapsed.md">Collapsed stacks</a></summary><ul><li>Groovy async-profiler CPU (<a href="examples/output/groovy.async-profiler.cpu.base.collapsed.md">base</a>, <a href="examples/output/groovy.async-profiler.cpu.current.collapsed.md">current</a>, <a href="examples/output/groovy.async-profiler.cpu.diff.collapsed.md">diff</a>)</li><li>Java async-profiler CPU (<a href="examples/output/java.async-profiler.cpu.base.collapsed.md">base</a>, <a href="examples/output/java.async-profiler.cpu.current.collapsed.md">current</a>, <a href="examples/output/java.async-profiler.cpu.diff.collapsed.md">diff</a>)</li><li>Kotlin async-profiler CPU (<a href="examples/output/kotlin.async-profiler.cpu.base.collapsed.md">base</a>, <a href="examples/output/kotlin.async-profiler.cpu.current.collapsed.md">current</a>, <a href="examples/output/kotlin.async-profiler.cpu.diff.collapsed.md">diff</a>)</li></ul></details>
331
+ <details><summary><a href="docs/formats/hprof.md">HPROF</a></summary><ul><li>Java JDK (<a href="examples/output/java.jdk.base.hprof.md">base</a>, <a href="examples/output/java.jdk.current.hprof.md">current</a>, <a href="examples/output/java.jdk.diff.hprof.md">diff</a>)</li></ul></details>
332
+ <details><summary><a href="docs/formats/jfr.md">JFR</a></summary><ul><li>Groovy async-profiler all (<a href="examples/output/groovy.async-profiler.all.base.jfr.md">base</a>, <a href="examples/output/groovy.async-profiler.all.current.jfr.md">current</a>, <a href="examples/output/groovy.async-profiler.all.diff.jfr.md">diff</a>)</li><li>Groovy async-profiler alloc (<a href="examples/output/groovy.async-profiler.alloc.base.jfr.md">base</a>, <a href="examples/output/groovy.async-profiler.alloc.current.jfr.md">current</a>, <a href="examples/output/groovy.async-profiler.alloc.diff.jfr.md">diff</a>)</li><li>Groovy async-profiler CPU (<a href="examples/output/groovy.async-profiler.cpu.base.jfr.md">base</a>, <a href="examples/output/groovy.async-profiler.cpu.current.jfr.md">current</a>, <a href="examples/output/groovy.async-profiler.cpu.diff.jfr.md">diff</a>)</li><li>Groovy async-profiler live (<a href="examples/output/groovy.async-profiler.live.base.jfr.md">base</a>, <a href="examples/output/groovy.async-profiler.live.current.jfr.md">current</a>, <a href="examples/output/groovy.async-profiler.live.diff.jfr.md">diff</a>)</li><li>Groovy async-profiler lock (<a href="examples/output/groovy.async-profiler.lock.base.jfr.md">base</a>, <a href="examples/output/groovy.async-profiler.lock.current.jfr.md">current</a>, <a href="examples/output/groovy.async-profiler.lock.diff.jfr.md">diff</a>)</li><li>Groovy async-profiler nativemem (<a href="examples/output/groovy.async-profiler.nativemem.base.jfr.md">base</a>, <a href="examples/output/groovy.async-profiler.nativemem.current.jfr.md">current</a>, <a href="examples/output/groovy.async-profiler.nativemem.diff.jfr.md">diff</a>)</li><li>Groovy async-profiler wall (<a href="examples/output/groovy.async-profiler.wall.base.jfr.md">base</a>, <a href="examples/output/groovy.async-profiler.wall.current.jfr.md">current</a>, <a href="examples/output/groovy.async-profiler.wall.diff.jfr.md">diff</a>)</li><li>Groovy JDK all (<a href="examples/output/groovy.jdk.all.base.jfr.md">base</a>, <a href="examples/output/groovy.jdk.all.current.jfr.md">current</a>, <a href="examples/output/groovy.jdk.all.diff.jfr.md">diff</a>)</li><li>Groovy JDK alloc (<a href="examples/output/groovy.jdk.alloc.base.jfr.md">base</a>, <a href="examples/output/groovy.jdk.alloc.current.jfr.md">current</a>, <a href="examples/output/groovy.jdk.alloc.diff.jfr.md">diff</a>)</li><li>Groovy JDK CPU (<a href="examples/output/groovy.jdk.cpu.base.jfr.md">base</a>, <a href="examples/output/groovy.jdk.cpu.current.jfr.md">current</a>, <a href="examples/output/groovy.jdk.cpu.diff.jfr.md">diff</a>)</li><li>Groovy JDK live (<a href="examples/output/groovy.jdk.live.base.jfr.md">base</a>, <a href="examples/output/groovy.jdk.live.current.jfr.md">current</a>, <a href="examples/output/groovy.jdk.live.diff.jfr.md">diff</a>)</li><li>Groovy JDK lock (<a href="examples/output/groovy.jdk.lock.base.jfr.md">base</a>, <a href="examples/output/groovy.jdk.lock.current.jfr.md">current</a>, <a href="examples/output/groovy.jdk.lock.diff.jfr.md">diff</a>)</li><li>Java async-profiler all (<a href="examples/output/java.async-profiler.all.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.all.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.all.diff.jfr.md">diff</a>)</li><li>Java async-profiler alloc (<a href="examples/output/java.async-profiler.alloc.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.alloc.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.alloc.diff.jfr.md">diff</a>)</li><li>Java async-profiler CPU (<a href="examples/output/java.async-profiler.cpu.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.cpu.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.cpu.diff.jfr.md">diff</a>)</li><li>Java async-profiler live (<a href="examples/output/java.async-profiler.live.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.live.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.live.diff.jfr.md">diff</a>)</li><li>Java async-profiler lock (<a href="examples/output/java.async-profiler.lock.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.lock.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.lock.diff.jfr.md">diff</a>)</li><li>Java async-profiler nativemem (<a href="examples/output/java.async-profiler.nativemem.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.nativemem.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.nativemem.diff.jfr.md">diff</a>)</li><li>Java async-profiler wall (<a href="examples/output/java.async-profiler.wall.base.jfr.md">base</a>, <a href="examples/output/java.async-profiler.wall.current.jfr.md">current</a>, <a href="examples/output/java.async-profiler.wall.diff.jfr.md">diff</a>)</li><li>Java JDK all (<a href="examples/output/java.jdk.all.base.jfr.md">base</a>, <a href="examples/output/java.jdk.all.current.jfr.md">current</a>, <a href="examples/output/java.jdk.all.diff.jfr.md">diff</a>)</li><li>Java JDK alloc (<a href="examples/output/java.jdk.alloc.base.jfr.md">base</a>, <a href="examples/output/java.jdk.alloc.current.jfr.md">current</a>, <a href="examples/output/java.jdk.alloc.diff.jfr.md">diff</a>)</li><li>Java JDK CPU (<a href="examples/output/java.jdk.cpu.base.jfr.md">base</a>, <a href="examples/output/java.jdk.cpu.current.jfr.md">current</a>, <a href="examples/output/java.jdk.cpu.diff.jfr.md">diff</a>)</li><li>Java JDK live (<a href="examples/output/java.jdk.live.base.jfr.md">base</a>, <a href="examples/output/java.jdk.live.current.jfr.md">current</a>, <a href="examples/output/java.jdk.live.diff.jfr.md">diff</a>)</li><li>Java JDK lock (<a href="examples/output/java.jdk.lock.base.jfr.md">base</a>, <a href="examples/output/java.jdk.lock.current.jfr.md">current</a>, <a href="examples/output/java.jdk.lock.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler all (<a href="examples/output/kotlin.async-profiler.all.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.all.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.all.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler alloc (<a href="examples/output/kotlin.async-profiler.alloc.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.alloc.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.alloc.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler CPU (<a href="examples/output/kotlin.async-profiler.cpu.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.cpu.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.cpu.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler live (<a href="examples/output/kotlin.async-profiler.live.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.live.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.live.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler lock (<a href="examples/output/kotlin.async-profiler.lock.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.lock.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.lock.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler nativemem (<a href="examples/output/kotlin.async-profiler.nativemem.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.nativemem.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.nativemem.diff.jfr.md">diff</a>)</li><li>Kotlin async-profiler wall (<a href="examples/output/kotlin.async-profiler.wall.base.jfr.md">base</a>, <a href="examples/output/kotlin.async-profiler.wall.current.jfr.md">current</a>, <a href="examples/output/kotlin.async-profiler.wall.diff.jfr.md">diff</a>)</li><li>Kotlin JDK all (<a href="examples/output/kotlin.jdk.all.base.jfr.md">base</a>, <a href="examples/output/kotlin.jdk.all.current.jfr.md">current</a>, <a href="examples/output/kotlin.jdk.all.diff.jfr.md">diff</a>)</li><li>Kotlin JDK alloc (<a href="examples/output/kotlin.jdk.alloc.base.jfr.md">base</a>, <a href="examples/output/kotlin.jdk.alloc.current.jfr.md">current</a>, <a href="examples/output/kotlin.jdk.alloc.diff.jfr.md">diff</a>)</li><li>Kotlin JDK CPU (<a href="examples/output/kotlin.jdk.cpu.base.jfr.md">base</a>, <a href="examples/output/kotlin.jdk.cpu.current.jfr.md">current</a>, <a href="examples/output/kotlin.jdk.cpu.diff.jfr.md">diff</a>)</li><li>Kotlin JDK live (<a href="examples/output/kotlin.jdk.live.base.jfr.md">base</a>, <a href="examples/output/kotlin.jdk.live.current.jfr.md">current</a>, <a href="examples/output/kotlin.jdk.live.diff.jfr.md">diff</a>)</li><li>Kotlin JDK lock (<a href="examples/output/kotlin.jdk.lock.base.jfr.md">base</a>, <a href="examples/output/kotlin.jdk.lock.current.jfr.md">current</a>, <a href="examples/output/kotlin.jdk.lock.diff.jfr.md">diff</a>)</li></ul></details>
107
333
  </td>
108
334
  </tr>
109
335
  <tr>
110
336
  <td><a href="docs/languages/javascript.md">JavaScript⁠/⁠TypeScript</a></td>
111
337
  <td>
112
- <div><a href="docs/formats/jsc-heap-snapshot.md">JSC heap snapshot</a>: <a href="examples/output/javascript.bun.base.jsc-heap-snapshot.json.md">base</a>, <a href="examples/output/javascript.bun.current.jsc-heap-snapshot.json.md">current</a>, <a href="examples/output/javascript.bun.diff.jsc-heap-snapshot.json.md">diff</a></div>
113
- <div><a href="docs/formats/pprof.md">pprof</a>:<ul><li>CPU (<a href="examples/output/javascript.pprof.cpu.base.pprof.md">base</a>, <a href="examples/output/javascript.pprof.cpu.current.pprof.md">current</a>, <a href="examples/output/javascript.pprof.cpu.diff.pprof.md">diff</a>)</li><li>Heap (<a href="examples/output/javascript.pprof.heap.base.pprof.md">base</a>, <a href="examples/output/javascript.pprof.heap.current.pprof.md">current</a>, <a href="examples/output/javascript.pprof.heap.diff.pprof.md">diff</a>)</li></ul></div>
114
- <div><a href="docs/formats/v8-cpu-profile.md">V8 CPU profile</a>:<ul><li>Bun (<a href="examples/output/javascript.bun.base.cpuprofile.md">base</a>, <a href="examples/output/javascript.bun.current.cpuprofile.md">current</a>, <a href="examples/output/javascript.bun.diff.cpuprofile.md">diff</a>)</li><li>Chrome (<a href="examples/output/javascript.chrome.base.cpuprofile.md">base</a>, <a href="examples/output/javascript.chrome.current.cpuprofile.md">current</a>, <a href="examples/output/javascript.chrome.diff.cpuprofile.md">diff</a>)</li><li>Deno (<a href="examples/output/javascript.deno.base.cpuprofile.md">base</a>, <a href="examples/output/javascript.deno.current.cpuprofile.md">current</a>, <a href="examples/output/javascript.deno.diff.cpuprofile.md">diff</a>)</li><li>Node.js (<a href="examples/output/javascript.node.base.cpuprofile.md">base</a>, <a href="examples/output/javascript.node.current.cpuprofile.md">current</a>, <a href="examples/output/javascript.node.diff.cpuprofile.md">diff</a>)</li></ul></div>
115
- <div><a href="docs/formats/v8-heap-profile.md">V8 heap profile</a>:<ul><li>Chrome (<a href="examples/output/javascript.chrome.base.heapprofile.md">base</a>, <a href="examples/output/javascript.chrome.current.heapprofile.md">current</a>, <a href="examples/output/javascript.chrome.diff.heapprofile.md">diff</a>)</li><li>Node.js (<a href="examples/output/javascript.node.base.heapprofile.md">base</a>, <a href="examples/output/javascript.node.current.heapprofile.md">current</a>, <a href="examples/output/javascript.node.diff.heapprofile.md">diff</a>)</li></ul></div>
116
- <div><a href="docs/formats/v8-heap-snapshot.md">V8 heap snapshot</a>:<ul><li>Bun (<a href="examples/output/javascript.bun.base.heapsnapshot.md">base</a>, <a href="examples/output/javascript.bun.current.heapsnapshot.md">current</a>, <a href="examples/output/javascript.bun.diff.heapsnapshot.md">diff</a>)</li><li>Chrome (<a href="examples/output/javascript.chrome.base.heapsnapshot.md">base</a>, <a href="examples/output/javascript.chrome.current.heapsnapshot.md">current</a>, <a href="examples/output/javascript.chrome.diff.heapsnapshot.md">diff</a>)</li><li>Node.js (<a href="examples/output/javascript.node.base.heapsnapshot.md">base</a>, <a href="examples/output/javascript.node.current.heapsnapshot.md">current</a>, <a href="examples/output/javascript.node.diff.heapsnapshot.md">diff</a>)</li></ul></div>
117
- <div><a href="docs/formats/webkit-timeline-recording.md">WebKit timeline recording</a>: <a href="examples/output/javascript.safari.base.webkit-timeline-recording.json.md">base</a>, <a href="examples/output/javascript.safari.current.webkit-timeline-recording.json.md">current</a>, <a href="examples/output/javascript.safari.diff.webkit-timeline-recording.json.md">diff</a></div>
338
+ <details><summary><a href="docs/formats/jsc-heap-snapshot.md">JSC heap snapshot</a></summary><ul><li>JavaScript Bun (<a href="examples/output/javascript.bun.base.jsc-heap-snapshot.json.md">base</a>, <a href="examples/output/javascript.bun.current.jsc-heap-snapshot.json.md">current</a>, <a href="examples/output/javascript.bun.diff.jsc-heap-snapshot.json.md">diff</a>)</li><li>JavaScript Safari (<a href="examples/output/javascript.safari.base.jsc-heap-snapshot.json.md">base</a>, <a href="examples/output/javascript.safari.current.jsc-heap-snapshot.json.md">current</a>, <a href="examples/output/javascript.safari.diff.jsc-heap-snapshot.json.md">diff</a>)</li></ul></details>
339
+ <details><summary><a href="docs/formats/pprof.md">pprof</a></summary><ul><li>JavaScript node-pprof CPU (<a href="examples/output/javascript.node-pprof.cpu.base.pprof.md">base</a>, <a href="examples/output/javascript.node-pprof.cpu.current.pprof.md">current</a>, <a href="examples/output/javascript.node-pprof.cpu.diff.pprof.md">diff</a>)</li><li>JavaScript node-pprof heap (<a href="examples/output/javascript.node-pprof.heap.base.pprof.md">base</a>, <a href="examples/output/javascript.node-pprof.heap.current.pprof.md">current</a>, <a href="examples/output/javascript.node-pprof.heap.diff.pprof.md">diff</a>)</li></ul></details>
340
+ <details><summary><a href="docs/formats/v8-cpu-profile.md">V8 CPU profile</a></summary><ul><li>JavaScript Bun (<a href="examples/output/javascript.bun.base.cpuprofile.md">base</a>, <a href="examples/output/javascript.bun.current.cpuprofile.md">current</a>, <a href="examples/output/javascript.bun.diff.cpuprofile.md">diff</a>)</li><li>JavaScript Chrome (<a href="examples/output/javascript.chrome.base.cpuprofile.md">base</a>, <a href="examples/output/javascript.chrome.current.cpuprofile.md">current</a>, <a href="examples/output/javascript.chrome.diff.cpuprofile.md">diff</a>)</li><li>JavaScript Deno (<a href="examples/output/javascript.deno.base.cpuprofile.md">base</a>, <a href="examples/output/javascript.deno.current.cpuprofile.md">current</a>, <a href="examples/output/javascript.deno.diff.cpuprofile.md">diff</a>)</li><li>JavaScript Node.js (<a href="examples/output/javascript.node.base.cpuprofile.md">base</a>, <a href="examples/output/javascript.node.current.cpuprofile.md">current</a>, <a href="examples/output/javascript.node.diff.cpuprofile.md">diff</a>)</li></ul></details>
341
+ <details><summary><a href="docs/formats/v8-heap-profile.md">V8 heap profile</a></summary><ul><li>JavaScript Chrome (<a href="examples/output/javascript.chrome.base.heapprofile.md">base</a>, <a href="examples/output/javascript.chrome.current.heapprofile.md">current</a>, <a href="examples/output/javascript.chrome.diff.heapprofile.md">diff</a>)</li><li>JavaScript Node.js (<a href="examples/output/javascript.node.base.heapprofile.md">base</a>, <a href="examples/output/javascript.node.current.heapprofile.md">current</a>, <a href="examples/output/javascript.node.diff.heapprofile.md">diff</a>)</li></ul></details>
342
+ <details><summary><a href="docs/formats/v8-heap-snapshot.md">V8 heap snapshot</a></summary><ul><li>JavaScript Bun (<a href="examples/output/javascript.bun.base.heapsnapshot.md">base</a>, <a href="examples/output/javascript.bun.current.heapsnapshot.md">current</a>, <a href="examples/output/javascript.bun.diff.heapsnapshot.md">diff</a>)</li><li>JavaScript Chrome (<a href="examples/output/javascript.chrome.base.heapsnapshot.md">base</a>, <a href="examples/output/javascript.chrome.current.heapsnapshot.md">current</a>, <a href="examples/output/javascript.chrome.diff.heapsnapshot.md">diff</a>)</li><li>JavaScript Node.js (<a href="examples/output/javascript.node.base.heapsnapshot.md">base</a>, <a href="examples/output/javascript.node.current.heapsnapshot.md">current</a>, <a href="examples/output/javascript.node.diff.heapsnapshot.md">diff</a>)</li></ul></details>
343
+ <details><summary><a href="docs/formats/webkit-timeline-recording.md">WebKit timeline recording</a></summary><ul><li>JavaScript Safari (<a href="examples/output/javascript.safari.base.webkit-timeline-recording.json.md">base</a>, <a href="examples/output/javascript.safari.current.webkit-timeline-recording.json.md">current</a>, <a href="examples/output/javascript.safari.diff.webkit-timeline-recording.json.md">diff</a>)</li></ul></details>
118
344
  </td>
119
345
  </tr>
120
346
  <tr>
121
347
  <td><a href="docs/languages/julia.md">Julia</a></td>
122
348
  <td>
123
- <div><a href="docs/formats/pprof.md">pprof</a>:<ul><li>Allocations (<a href="examples/output/julia.pprof-jl.alloc.base.pprof.md">base</a>, <a href="examples/output/julia.pprof-jl.alloc.current.pprof.md">current</a>, <a href="examples/output/julia.pprof-jl.alloc.diff.pprof.md">diff</a>)</li><li>CPU (<a href="examples/output/julia.pprof-jl.cpu.base.pprof.md">base</a>, <a href="examples/output/julia.pprof-jl.cpu.current.pprof.md">current</a>, <a href="examples/output/julia.pprof-jl.cpu.diff.pprof.md">diff</a>)</li><li>Wall (<a href="examples/output/julia.pprof-jl.wall.base.pprof.md">base</a>, <a href="examples/output/julia.pprof-jl.wall.current.pprof.md">current</a>, <a href="examples/output/julia.pprof-jl.wall.diff.pprof.md">diff</a>)</li></ul></div>
124
- <div><a href="docs/formats/v8-heap-snapshot.md">V8 heap snapshot</a>: <a href="examples/output/julia.profile.base.heapsnapshot.md">base</a>, <a href="examples/output/julia.profile.current.heapsnapshot.md">current</a>, <a href="examples/output/julia.profile.diff.heapsnapshot.md">diff</a></div>
349
+ <details><summary><a href="docs/formats/pprof.md">pprof</a></summary><ul><li>Julia pprof-jl alloc (<a href="examples/output/julia.pprof-jl.alloc.base.pprof.md">base</a>, <a href="examples/output/julia.pprof-jl.alloc.current.pprof.md">current</a>, <a href="examples/output/julia.pprof-jl.alloc.diff.pprof.md">diff</a>)</li><li>Julia pprof-jl CPU (<a href="examples/output/julia.pprof-jl.cpu.base.pprof.md">base</a>, <a href="examples/output/julia.pprof-jl.cpu.current.pprof.md">current</a>, <a href="examples/output/julia.pprof-jl.cpu.diff.pprof.md">diff</a>)</li><li>Julia pprof-jl wall (<a href="examples/output/julia.pprof-jl.wall.base.pprof.md">base</a>, <a href="examples/output/julia.pprof-jl.wall.current.pprof.md">current</a>, <a href="examples/output/julia.pprof-jl.wall.diff.pprof.md">diff</a>)</li></ul></details>
350
+ <details><summary><a href="docs/formats/v8-heap-snapshot.md">V8 heap snapshot</a></summary><ul><li>Julia Profile (<a href="examples/output/julia.profile-jl.base.heapsnapshot.md">base</a>, <a href="examples/output/julia.profile-jl.current.heapsnapshot.md">current</a>, <a href="examples/output/julia.profile-jl.diff.heapsnapshot.md">diff</a>)</li></ul></details>
125
351
  </td>
126
352
  </tr>
127
353
  <tr>
128
354
  <td><a href="docs/languages/php.md">PHP</a></td>
129
355
  <td>
130
- <div><a href="docs/formats/speedscope.md">Speedscope</a>: <a href="examples/output/php.excimer.wall.base.speedscope.json.md">base</a>, <a href="examples/output/php.excimer.wall.current.speedscope.json.md">current</a>, <a href="examples/output/php.excimer.wall.diff.speedscope.json.md">diff</a></div>
356
+ <details><summary><a href="docs/formats/speedscope.md">Speedscope</a></summary><ul><li>PHP Excimer wall (<a href="examples/output/php.excimer.wall.base.speedscope.json.md">base</a>, <a href="examples/output/php.excimer.wall.current.speedscope.json.md">current</a>, <a href="examples/output/php.excimer.wall.diff.speedscope.json.md">diff</a>)</li></ul></details>
131
357
  </td>
132
358
  </tr>
133
359
  <tr>
134
360
  <td><a href="docs/languages/python.md">Python</a></td>
135
361
  <td>
136
- <div><a href="docs/formats/collapsed.md">Collapsed stacks</a>:<ul><li>CPU (<a href="examples/output/python.py-spy.cpu.base.collapsed.md">base</a>, <a href="examples/output/python.py-spy.cpu.current.collapsed.md">current</a>, <a href="examples/output/python.py-spy.cpu.diff.collapsed.md">diff</a>)</li><li>Wall (<a href="examples/output/python.py-spy.wall.base.collapsed.md">base</a>, <a href="examples/output/python.py-spy.wall.current.collapsed.md">current</a>, <a href="examples/output/python.py-spy.wall.diff.collapsed.md">diff</a>)</li></ul></div>
137
- <div><a href="docs/formats/speedscope.md">Speedscope</a>: <a href="examples/output/python.py-spy.cpu.base.speedscope.json.md">base</a>, <a href="examples/output/python.py-spy.cpu.current.speedscope.json.md">current</a>, <a href="examples/output/python.py-spy.cpu.diff.speedscope.json.md">diff</a></div>
138
- <div><a href="docs/formats/systing.md">systing profile export</a></div>
362
+ <details><summary><a href="docs/formats/collapsed.md">Collapsed stacks</a></summary><ul><li>Python py-spy CPU (<a href="examples/output/python.py-spy.cpu.base.collapsed.md">base</a>, <a href="examples/output/python.py-spy.cpu.current.collapsed.md">current</a>, <a href="examples/output/python.py-spy.cpu.diff.collapsed.md">diff</a>)</li><li>Python py-spy wall (<a href="examples/output/python.py-spy.wall.base.collapsed.md">base</a>, <a href="examples/output/python.py-spy.wall.current.collapsed.md">current</a>, <a href="examples/output/python.py-spy.wall.diff.collapsed.md">diff</a>)</li></ul></details>
363
+ <details><summary><a href="docs/formats/memray.md">memray</a></summary><ul><li>Python memray (<a href="examples/output/python.memray.base.memray.bin.md">base</a>, <a href="examples/output/python.memray.current.memray.bin.md">current</a>, <a href="examples/output/python.memray.diff.memray.bin.md">diff</a>)</li><li>Python memray aggregated (<a href="examples/output/python.memray.aggregated.base.memray.bin.md">base</a>, <a href="examples/output/python.memray.aggregated.current.memray.bin.md">current</a>, <a href="examples/output/python.memray.aggregated.diff.memray.bin.md">diff</a>)</li><li>Python memray v13 (<a href="examples/output/python.memray.v13.base.memray.bin.md">base</a>, <a href="examples/output/python.memray.v13.current.memray.bin.md">current</a>, <a href="examples/output/python.memray.v13.diff.memray.bin.md">diff</a>)</li></ul></details>
364
+ <details><summary><a href="docs/formats/speedscope.md">Speedscope</a></summary><ul><li>Python py-spy CPU (<a href="examples/output/python.py-spy.cpu.base.speedscope.json.md">base</a>, <a href="examples/output/python.py-spy.cpu.current.speedscope.json.md">current</a>, <a href="examples/output/python.py-spy.cpu.diff.speedscope.json.md">diff</a>)</li><li>Python pyinstrument (<a href="examples/output/python.pyinstrument.base.speedscope.json.md">base</a>, <a href="examples/output/python.pyinstrument.current.speedscope.json.md">current</a>, <a href="examples/output/python.pyinstrument.diff.speedscope.json.md">diff</a>)</li></ul></details>
365
+ <div><a href="docs/formats/systing.md">systing</a></div>
139
366
  </td>
140
367
  </tr>
141
368
  <tr>
142
369
  <td><a href="docs/languages/ruby.md">Ruby</a></td>
143
370
  <td>
144
- <div><a href="docs/formats/collapsed.md">Collapsed stacks</a>: <a href="examples/output/ruby.rbspy.cpu.base.collapsed.md">base</a>, <a href="examples/output/ruby.rbspy.cpu.current.collapsed.md">current</a>, <a href="examples/output/ruby.rbspy.cpu.diff.collapsed.md">diff</a></div>
145
- <div><a href="docs/formats/pprof.md">pprof</a>: <a href="examples/output/ruby.rbspy.cpu.base.pprof.md">base</a>, <a href="examples/output/ruby.rbspy.cpu.current.pprof.md">current</a>, <a href="examples/output/ruby.rbspy.cpu.diff.pprof.md">diff</a></div>
146
- <div><a href="docs/formats/speedscope.md">Speedscope</a>: <a href="examples/output/ruby.rbspy.cpu.base.speedscope.json.md">base</a>, <a href="examples/output/ruby.rbspy.cpu.current.speedscope.json.md">current</a>, <a href="examples/output/ruby.rbspy.cpu.diff.speedscope.json.md">diff</a></div>
371
+ <details><summary><a href="docs/formats/callgrind.md">Callgrind</a></summary><ul><li>Ruby rbspy CPU (<a href="examples/output/ruby.rbspy.cpu.base.callgrind.md">base</a>, <a href="examples/output/ruby.rbspy.cpu.current.callgrind.md">current</a>, <a href="examples/output/ruby.rbspy.cpu.diff.callgrind.md">diff</a>)</li></ul></details>
372
+ <details><summary><a href="docs/formats/collapsed.md">Collapsed stacks</a></summary><ul><li>Ruby rbspy CPU (<a href="examples/output/ruby.rbspy.cpu.base.collapsed.md">base</a>, <a href="examples/output/ruby.rbspy.cpu.current.collapsed.md">current</a>, <a href="examples/output/ruby.rbspy.cpu.diff.collapsed.md">diff</a>)</li></ul></details>
373
+ <details><summary><a href="docs/formats/pprof.md">pprof</a></summary><ul><li>Ruby rbspy CPU (<a href="examples/output/ruby.rbspy.cpu.base.pprof.md">base</a>, <a href="examples/output/ruby.rbspy.cpu.current.pprof.md">current</a>, <a href="examples/output/ruby.rbspy.cpu.diff.pprof.md">diff</a>)</li></ul></details>
374
+ <details><summary><a href="docs/formats/speedscope.md">Speedscope</a></summary><ul><li>Ruby rbspy CPU (<a href="examples/output/ruby.rbspy.cpu.base.speedscope.json.md">base</a>, <a href="examples/output/ruby.rbspy.cpu.current.speedscope.json.md">current</a>, <a href="examples/output/ruby.rbspy.cpu.diff.speedscope.json.md">diff</a>)</li></ul></details>
147
375
  </td>
148
376
  </tr>
149
377
  <tr>
150
378
  <td><a href="docs/languages/rust.md">Rust</a></td>
151
379
  <td>
152
- <div><a href="docs/formats/pprof.md">pprof</a>: <a href="examples/output/rust.pprof-rs.cpu.base.pprof.md">base</a>, <a href="examples/output/rust.pprof-rs.cpu.current.pprof.md">current</a>, <a href="examples/output/rust.pprof-rs.cpu.diff.pprof.md">diff</a></div>
153
- <div><a href="docs/formats/systing.md">systing profile export</a></div>
380
+ <details><summary><a href="docs/formats/pprof.md">pprof</a></summary><ul><li>Rust pprof-rs CPU (<a href="examples/output/rust.pprof-rs.cpu.base.pprof.md">base</a>, <a href="examples/output/rust.pprof-rs.cpu.current.pprof.md">current</a>, <a href="examples/output/rust.pprof-rs.cpu.diff.pprof.md">diff</a>)</li></ul></details>
381
+ <div><a href="docs/formats/systing.md">systing</a></div>
382
+ </td>
383
+ </tr>
384
+ <tr>
385
+ <td><a href="docs/languages/swift.md">Swift</a></td>
386
+ <td>
387
+ <details><summary><a href="docs/formats/pprof.md">pprof</a></summary><ul><li>Swift gperftools CPU (<a href="examples/output/swift.gperftools.cpu.base.pprof.md">base</a>, <a href="examples/output/swift.gperftools.cpu.current.pprof.md">current</a>, <a href="examples/output/swift.gperftools.cpu.diff.pprof.md">diff</a>)</li><li>Swift gperftools heap (<a href="examples/output/swift.gperftools.heap.base.pprof.md">base</a>, <a href="examples/output/swift.gperftools.heap.current.pprof.md">current</a>, <a href="examples/output/swift.gperftools.heap.diff.pprof.md">diff</a>)</li></ul></details>
388
+ </td>
389
+ </tr>
390
+ <tr>
391
+ <td><a href="docs/languages/zig.md">Zig</a></td>
392
+ <td>
393
+ <details><summary><a href="docs/formats/perf.md">perf.data</a></summary><ul><li>Zig perf CPU (<a href="examples/output/zig.perf.cpu.base.perf.data.md">base</a>, <a href="examples/output/zig.perf.cpu.current.perf.data.md">current</a>, <a href="examples/output/zig.perf.cpu.diff.perf.data.md">diff</a>)</li></ul></details>
394
+ <details><summary><a href="docs/formats/pprof.md">pprof</a></summary><ul><li>Zig gperftools CPU (<a href="examples/output/zig.gperftools.cpu.base.pprof.md">base</a>, <a href="examples/output/zig.gperftools.cpu.current.pprof.md">current</a>, <a href="examples/output/zig.gperftools.cpu.diff.pprof.md">diff</a>)</li><li>Zig gperftools heap (<a href="examples/output/zig.gperftools.heap.base.pprof.md">base</a>, <a href="examples/output/zig.gperftools.heap.current.pprof.md">current</a>, <a href="examples/output/zig.gperftools.heap.diff.pprof.md">diff</a>)</li></ul></details>
154
395
  </td>
155
396
  </tr>
156
397
  </tbody>
@@ -160,211 +401,12 @@ it. Third-party tools can often convert others, though.
160
401
 
161
402
  <!-- prettier-ignore-end -->
162
403
 
163
- ## Install
164
-
165
- ```sh
166
- $ npm i -g profiler-md
167
- ```
168
-
169
- ## Usage
170
-
171
- ### CLI
172
-
173
- <!-- prettier-ignore-start -->
174
-
175
- <!-- CLI_HELP START -->
176
-
177
- ```sh
178
- $ profiler-md --help
179
- Usage: profiler-md [(-h/--help [TOPIC])] [-f/--format FORMAT] [-r/--origin
180
- ORIGIN] [-o/--output FILE] [--top-n N] [--base-url STRING] [--source-maps
181
- GLOB...] [--match REGEX=REPLACEMENT...] [--third-party GLOB...] [
182
- --no-pager] [--color/--no-color] ([FILE] | BASE CURRENT)
183
-
184
- Converts performance profiles to human and LLM friendly Markdown.
185
-
186
- -h, --help [TOPIC] Show this help message or topic docs
187
- -f, --format FORMAT Input profile format (default: auto)
188
- -r, --origin ORIGIN Input profile origin (default: auto)
189
- -o, --output FILE Output file (default: - for stdout)
190
- --top-n N Top entries to show (default: 20)
191
- --base-url STRING Base URL or path to show paths relative to, or
192
- "auto" to infer the common ancestor directory
193
- (default: cwd)
194
- --source-maps GLOB Source maps (JSON or inline) to apply to profile
195
- locations (repeatable)
196
- --match REGEX=REPLACEMENT Treat locations matching REGEX as REPLACEMENT
197
- when matching entries across diffed profiles
198
- (repeatable)
199
- --third-party GLOB Additional URLs or paths to consider third-party
200
- (repeatable)
201
- --no-pager Disable stdout paging (default: auto)
202
- --color, --no-color Enable or disable ANSI syntax highlighting
203
- (default: auto)
204
- FILE Profile to convert (default: stdin)
205
- BASE Base profile to diff
206
- CURRENT Current profile to diff against the base
207
-
208
- Formats: collapsed, jfr, jsc-heap-snapshot, pprof, speedscope, systing, v8-cpu-profile, v8-heap-profile, v8-heap-snapshot, webkit-timeline-recording
209
- Origins: beam, bun, deno, dotnet-trace, go, jvm, node, node-pprof, pprof-jl, pprof-rs, py-spy, rbspy, safari, systing, tachyon, unknown
210
- Languages: c/cpp, csharp/fsharp, elixir/erlang, go, java/kotlin, javascript/typescript, julia, php, python, ruby, rust
211
- ```
212
-
213
- <!-- CLI_HELP END -->
214
-
215
- <!-- prettier-ignore-end -->
216
-
217
- ### API
218
-
219
- ```js
220
- import { openAsBlob, readFileSync } from 'node:fs'
221
- import {
222
- defaultCategorizeEntries,
223
- defaultMatchEntry,
224
- defaultShowEntry,
225
- diffProfiles,
226
- diffProfilesAsync,
227
- profileToMd,
228
- profileToMdAsync,
229
- } from 'profiler-md'
230
-
231
- // Auto-detect format and origin (async)
232
- console.log(await profileToMdAsync(await openAsBlob(`example.cpuprofile`)))
233
- console.log(await profileToMdAsync(await openAsBlob(`example.pprof`)))
234
-
235
- // Explicit format
236
- console.log(
237
- await profileToMdAsync({
238
- data: await openAsBlob(`example.pprof`),
239
- format: `pprof`,
240
- }),
241
- )
242
- // Explicit origin
243
- console.log(
244
- await profileToMdAsync({
245
- data: await openAsBlob(`example.cpuprofile`),
246
- origin: `deno`,
247
- }),
248
- )
249
-
250
- // Synchronous usage (auto-detect)
251
- console.log(profileToMd(readFileSync(`example.cpuprofile`, `utf8`)))
252
- console.log(profileToMd(readFileSync(`example.pprof`)))
253
-
254
- // Synchronous usage with explicit format and origin
255
- console.log(
256
- profileToMd({
257
- data: readFileSync(`example.pprof`),
258
- format: `pprof`,
259
- origin: `node-pprof`,
260
- }),
261
- )
262
-
263
- // Diff two profiles or two heap snapshots (async, auto-detect)
264
- console.log(
265
- await diffProfilesAsync(
266
- await openAsBlob(`base.cpuprofile`),
267
- await openAsBlob(`current.cpuprofile`),
268
- ),
269
- )
270
- console.log(
271
- await diffProfilesAsync(
272
- await openAsBlob(`base.heapsnapshot`),
273
- await openAsBlob(`current.heapsnapshot`),
274
- ),
275
- )
276
-
277
- // Synchronous diff with explicit format
278
- console.log(
279
- diffProfiles(
280
- { data: readFileSync(`base.pprof`), format: `pprof` },
281
- { data: readFileSync(`current.pprof`), format: `pprof` },
282
- ),
283
- )
284
-
285
- // Complex usage
286
- const options = {
287
- // Show top 10 functions instead of the default 20.
288
- topN: 10,
289
- // Make paths relative to a custom base URL or directory, or pass `auto` to
290
- // infer the profiled files' common ancestor directory.
291
- baseURL: `/path/to/project`,
292
- matchEntry: (entry, context) => {
293
- if (entry.location?.url.pathname.includes(`/bundle.`)) {
294
- // Match bundled entries when diffing by name only, ignoring
295
- // content-hashed filenames.
296
- return { name: entry.name }
297
- }
298
- return defaultMatchEntry(entry, context)
299
- },
300
- categorizeEntries: (entries, context) => {
301
- const categories = defaultCategorizeEntries(entries, context)
302
- return entries.map((entry, index) =>
303
- // Treat an additional vendor directory as third-party.
304
- entry.location?.url?.pathname.includes(`/vendor/`)
305
- ? `third-party`
306
- : categories[index],
307
- )
308
- },
309
- showEntry: entry =>
310
- defaultShowEntry(entry) &&
311
- // Exclude entries from a specific file.
312
- !entry.location?.includes(`/path/to/project/src/noisy`),
313
- }
314
- console.log(await profileToMdAsync(await openAsBlob(`example.pprof`), options))
315
- console.log(
316
- await profileToMdAsync(await openAsBlob(`example.cpuprofile`), options),
317
- )
318
-
319
- // The same options apply to diffs. `matchEntry` takes effect only here, where
320
- // it controls which entries count as the same across the two sides.
321
- console.log(
322
- await diffProfilesAsync(
323
- await openAsBlob(`base.pprof`),
324
- await openAsBlob(`current.pprof`),
325
- options,
326
- ),
327
- )
328
- ```
329
-
330
- ## Shell completions
331
-
332
- ```sh
333
- # Bash (Linux)
334
- $ profiler-md --completion bash > ~/.local/share/bash-completion/completions/profiler-md
335
-
336
- # Bash (macOS/Homebrew)
337
- $ profiler-md --completion bash > $(brew --prefix)/etc/bash_completion.d/profiler-md
338
-
339
- # Fish
340
- $ profiler-md --completion fish > ~/.config/fish/completions/profiler-md.fish
341
-
342
- # Zsh
343
- $ profiler-md --completion zsh > ~/.zfunc/_profiler-md
344
-
345
- # PowerShell
346
- $ profiler-md --completion pwsh >> $PROFILE.CurrentUserCurrentHost
347
- ```
348
-
349
- ## Skills
350
-
351
- Use the [`profiler-md` skill](./skills/profile-optimize/SKILL.md) to have an
352
- agent profile and optimize your code:
353
-
354
- ```sh
355
- $ npx skills add TomerAberbach/profiler-md --skill profile-optimize
356
- ```
357
-
358
- See [skills.sh](https://skills.sh/docs) for more info.
359
-
360
- Fun fact: the skill has profiled and optimized `profiler-md` itself!
361
-
362
404
  ## Contributing
363
405
 
364
406
  Stars are always welcome!
365
407
 
366
408
  For bugs and feature requests,
367
- [please create an issue](https://github.com/TomerAberbach/profiler-md/issues/new).
409
+ [create an issue](https://github.com/TomerAberbach/profiler-md/issues/new).
368
410
 
369
411
  ## License
370
412