profiler-md 0.3.0 → 0.5.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 (225) hide show
  1. package/dist/cli/index.mjs +5331 -2044
  2. package/dist/index.d.mts +738 -229
  3. package/dist/index.js +2 -2
  4. package/docs/formats/collapsed.md +12 -0
  5. package/docs/formats/jfr.md +16 -0
  6. package/docs/formats/jsc-heap-snapshot.md +2 -2
  7. package/docs/languages/c.md +31 -7
  8. package/docs/languages/cpp.md +160 -0
  9. package/docs/languages/csharp.md +52 -0
  10. package/docs/languages/elixir.md +46 -0
  11. package/docs/languages/erlang.md +46 -0
  12. package/docs/languages/fsharp.md +52 -0
  13. package/docs/languages/go.md +11 -6
  14. package/docs/languages/java.md +110 -57
  15. package/docs/languages/javascript.md +69 -12
  16. package/docs/languages/julia.md +54 -0
  17. package/docs/languages/kotlin.md +170 -0
  18. package/docs/languages/php.md +64 -20
  19. package/docs/languages/python.md +13 -68
  20. package/docs/languages/ruby.md +17 -27
  21. package/docs/languages/typescript.md +276 -0
  22. package/examples/output/c.gperftools.cpu.base.pprof.md +324 -0
  23. package/examples/output/c.gperftools.cpu.current.pprof.md +271 -0
  24. package/examples/output/c.gperftools.cpu.diff.pprof.md +98 -0
  25. package/examples/output/c.gperftools.heap.base.pprof.md +362 -0
  26. package/examples/output/c.gperftools.heap.current.pprof.md +362 -0
  27. package/examples/output/c.gperftools.heap.diff.pprof.md +28 -0
  28. package/examples/output/cpp.gperftools.cpu.base.pprof.md +557 -0
  29. package/examples/output/cpp.gperftools.cpu.current.pprof.md +573 -0
  30. package/examples/output/cpp.gperftools.cpu.diff.pprof.md +122 -0
  31. package/examples/output/cpp.gperftools.heap.base.pprof.md +67 -0
  32. package/examples/output/cpp.gperftools.heap.current.pprof.md +67 -0
  33. package/examples/output/cpp.gperftools.heap.diff.pprof.md +19 -0
  34. package/examples/output/csharp.dotnet-trace.base.speedscope.json.md +411 -0
  35. package/examples/output/csharp.dotnet-trace.current.speedscope.json.md +412 -0
  36. package/examples/output/csharp.dotnet-trace.diff.speedscope.json.md +122 -0
  37. package/examples/output/elixir.eflambe.cpu.base.collapsed.md +399 -0
  38. package/examples/output/elixir.eflambe.cpu.current.collapsed.md +398 -0
  39. package/examples/output/elixir.eflambe.cpu.diff.collapsed.md +92 -0
  40. package/examples/output/erlang.eflambe.cpu.base.collapsed.md +147 -0
  41. package/examples/output/erlang.eflambe.cpu.current.collapsed.md +147 -0
  42. package/examples/output/erlang.eflambe.cpu.diff.collapsed.md +18 -0
  43. package/examples/output/fsharp.dotnet-trace.base.speedscope.json.md +324 -0
  44. package/examples/output/fsharp.dotnet-trace.current.speedscope.json.md +314 -0
  45. package/examples/output/fsharp.dotnet-trace.diff.speedscope.json.md +119 -0
  46. package/examples/output/go.pprof.block.base.pprof.md +86 -0
  47. package/examples/output/go.pprof.block.current.pprof.md +83 -0
  48. package/examples/output/go.pprof.block.diff.pprof.md +42 -0
  49. package/examples/output/go.pprof.cpu.base.pprof.md +81 -0
  50. package/examples/output/go.pprof.cpu.current.pprof.md +70 -0
  51. package/examples/output/go.pprof.cpu.diff.pprof.md +52 -0
  52. package/examples/output/go.pprof.goroutine.base.pprof.md +43 -0
  53. package/examples/output/go.pprof.goroutine.current.pprof.md +43 -0
  54. package/examples/output/go.pprof.goroutine.diff.pprof.md +13 -0
  55. package/examples/output/go.pprof.heap-alloc.base.pprof.md +154 -0
  56. package/examples/output/go.pprof.heap-alloc.current.pprof.md +146 -0
  57. package/examples/output/go.pprof.heap-alloc.diff.pprof.md +67 -0
  58. package/examples/output/go.pprof.heap.base.pprof.md +154 -0
  59. package/examples/output/go.pprof.heap.current.pprof.md +146 -0
  60. package/examples/output/go.pprof.heap.diff.pprof.md +67 -0
  61. package/examples/output/go.pprof.mutex.base.pprof.md +55 -0
  62. package/examples/output/go.pprof.mutex.current.pprof.md +41 -0
  63. package/examples/output/go.pprof.mutex.diff.pprof.md +31 -0
  64. package/examples/output/go.pprof.threadcreate.base.pprof.md +55 -0
  65. package/examples/output/go.pprof.threadcreate.current.pprof.md +55 -0
  66. package/examples/output/go.pprof.threadcreate.diff.pprof.md +19 -0
  67. package/examples/output/java.async-profiler.all.base.jfr.md +1071 -0
  68. package/examples/output/java.async-profiler.all.current.jfr.md +1007 -0
  69. package/examples/output/java.async-profiler.all.diff.jfr.md +268 -0
  70. package/examples/output/java.async-profiler.alloc.base.jfr.md +425 -0
  71. package/examples/output/java.async-profiler.alloc.current.jfr.md +413 -0
  72. package/examples/output/java.async-profiler.alloc.diff.jfr.md +99 -0
  73. package/examples/output/java.async-profiler.cpu.base.collapsed.md +367 -0
  74. package/examples/output/java.async-profiler.cpu.base.jfr.md +485 -0
  75. package/examples/output/java.async-profiler.cpu.current.collapsed.md +355 -0
  76. package/examples/output/java.async-profiler.cpu.current.jfr.md +488 -0
  77. package/examples/output/java.async-profiler.cpu.diff.collapsed.md +117 -0
  78. package/examples/output/java.async-profiler.cpu.diff.jfr.md +118 -0
  79. package/examples/output/java.async-profiler.live.base.jfr.md +697 -0
  80. package/examples/output/java.async-profiler.live.current.jfr.md +684 -0
  81. package/examples/output/java.async-profiler.live.diff.jfr.md +191 -0
  82. package/examples/output/java.async-profiler.lock.base.jfr.md +140 -0
  83. package/examples/output/java.async-profiler.lock.current.jfr.md +108 -0
  84. package/examples/output/java.async-profiler.lock.diff.jfr.md +44 -0
  85. package/examples/output/java.async-profiler.nativemem.base.jfr.md +222 -0
  86. package/examples/output/java.async-profiler.nativemem.current.jfr.md +222 -0
  87. package/examples/output/java.async-profiler.nativemem.diff.jfr.md +65 -0
  88. package/examples/output/java.async-profiler.wall.base.jfr.md +400 -0
  89. package/examples/output/java.async-profiler.wall.current.jfr.md +420 -0
  90. package/examples/output/java.async-profiler.wall.diff.jfr.md +94 -0
  91. package/examples/output/java.jdk.all.base.jfr.md +1024 -0
  92. package/examples/output/java.jdk.all.current.jfr.md +1010 -0
  93. package/examples/output/java.jdk.all.diff.jfr.md +311 -0
  94. package/examples/output/java.jdk.alloc.base.jfr.md +1024 -0
  95. package/examples/output/java.jdk.alloc.current.jfr.md +1046 -0
  96. package/examples/output/java.jdk.alloc.diff.jfr.md +312 -0
  97. package/examples/output/java.jdk.cpu.base.jfr.md +1023 -0
  98. package/examples/output/java.jdk.cpu.current.jfr.md +1039 -0
  99. package/examples/output/java.jdk.cpu.diff.jfr.md +285 -0
  100. package/examples/output/java.jdk.live.base.jfr.md +1029 -0
  101. package/examples/output/java.jdk.live.current.jfr.md +1035 -0
  102. package/examples/output/java.jdk.live.diff.jfr.md +289 -0
  103. package/examples/output/java.jdk.lock.base.jfr.md +1040 -0
  104. package/examples/output/java.jdk.lock.current.jfr.md +1051 -0
  105. package/examples/output/java.jdk.lock.diff.jfr.md +339 -0
  106. package/examples/output/javascript.bun.base.cpuprofile.md +73 -0
  107. package/examples/output/javascript.bun.base.heapsnapshot.md +608 -0
  108. package/examples/output/javascript.bun.base.jsc-heap-snapshot.json.md +480 -0
  109. package/examples/output/javascript.bun.current.cpuprofile.md +73 -0
  110. package/examples/output/javascript.bun.current.heapsnapshot.md +608 -0
  111. package/examples/output/javascript.bun.current.jsc-heap-snapshot.json.md +480 -0
  112. package/examples/output/javascript.bun.diff.cpuprofile.md +54 -0
  113. package/examples/output/javascript.bun.diff.heapsnapshot.md +48 -0
  114. package/examples/output/javascript.bun.diff.jsc-heap-snapshot.json.md +62 -0
  115. package/examples/output/javascript.chrome.base.cpuprofile.md +163 -0
  116. package/examples/output/javascript.chrome.base.heapprofile.md +32 -0
  117. package/examples/output/javascript.chrome.base.heapsnapshot.md +649 -0
  118. package/examples/output/javascript.chrome.current.cpuprofile.md +149 -0
  119. package/examples/output/javascript.chrome.current.heapprofile.md +32 -0
  120. package/examples/output/javascript.chrome.current.heapsnapshot.md +647 -0
  121. package/examples/output/javascript.chrome.diff.cpuprofile.md +65 -0
  122. package/examples/output/javascript.chrome.diff.heapprofile.md +50 -0
  123. package/examples/output/javascript.chrome.diff.heapsnapshot.md +73 -0
  124. package/examples/output/javascript.deno.base.cpuprofile.md +122 -0
  125. package/examples/output/javascript.deno.current.cpuprofile.md +114 -0
  126. package/examples/output/javascript.deno.diff.cpuprofile.md +66 -0
  127. package/examples/output/javascript.node.base.cpuprofile.md +136 -0
  128. package/examples/output/javascript.node.base.heapprofile.md +56 -0
  129. package/examples/output/javascript.node.base.heapsnapshot.md +660 -0
  130. package/examples/output/javascript.node.current.cpuprofile.md +119 -0
  131. package/examples/output/javascript.node.current.heapprofile.md +52 -0
  132. package/examples/output/javascript.node.current.heapsnapshot.md +660 -0
  133. package/examples/output/javascript.node.diff.cpuprofile.md +70 -0
  134. package/examples/output/javascript.node.diff.heapprofile.md +34 -0
  135. package/examples/output/javascript.node.diff.heapsnapshot.md +39 -0
  136. package/examples/output/javascript.pprof.cpu.base.pprof.md +104 -0
  137. package/examples/output/javascript.pprof.cpu.current.pprof.md +120 -0
  138. package/examples/output/javascript.pprof.cpu.diff.pprof.md +63 -0
  139. package/examples/output/javascript.pprof.heap.base.pprof.md +86 -0
  140. package/examples/output/javascript.pprof.heap.current.pprof.md +57 -0
  141. package/examples/output/javascript.pprof.heap.diff.pprof.md +42 -0
  142. package/examples/output/javascript.safari.base.webkit-timeline-recording.json.md +388 -0
  143. package/examples/output/javascript.safari.current.webkit-timeline-recording.json.md +378 -0
  144. package/examples/output/javascript.safari.diff.webkit-timeline-recording.json.md +122 -0
  145. package/examples/output/julia.pprof-jl.alloc.base.pprof.md +124 -0
  146. package/examples/output/julia.pprof-jl.alloc.current.pprof.md +126 -0
  147. package/examples/output/julia.pprof-jl.alloc.diff.pprof.md +30 -0
  148. package/examples/output/julia.pprof-jl.cpu.base.pprof.md +177 -0
  149. package/examples/output/julia.pprof-jl.cpu.current.pprof.md +179 -0
  150. package/examples/output/julia.pprof-jl.cpu.diff.pprof.md +64 -0
  151. package/examples/output/kotlin.async-profiler.all.base.jfr.md +920 -0
  152. package/examples/output/kotlin.async-profiler.all.current.jfr.md +925 -0
  153. package/examples/output/kotlin.async-profiler.all.diff.jfr.md +247 -0
  154. package/examples/output/kotlin.async-profiler.alloc.base.jfr.md +467 -0
  155. package/examples/output/kotlin.async-profiler.alloc.current.jfr.md +473 -0
  156. package/examples/output/kotlin.async-profiler.alloc.diff.jfr.md +122 -0
  157. package/examples/output/kotlin.async-profiler.cpu.base.collapsed.md +371 -0
  158. package/examples/output/kotlin.async-profiler.cpu.base.jfr.md +472 -0
  159. package/examples/output/kotlin.async-profiler.cpu.current.collapsed.md +370 -0
  160. package/examples/output/kotlin.async-profiler.cpu.current.jfr.md +445 -0
  161. package/examples/output/kotlin.async-profiler.cpu.diff.collapsed.md +124 -0
  162. package/examples/output/kotlin.async-profiler.cpu.diff.jfr.md +125 -0
  163. package/examples/output/kotlin.async-profiler.live.base.jfr.md +934 -0
  164. package/examples/output/kotlin.async-profiler.live.current.jfr.md +917 -0
  165. package/examples/output/kotlin.async-profiler.live.diff.jfr.md +245 -0
  166. package/examples/output/kotlin.async-profiler.lock.base.jfr.md +1 -0
  167. package/examples/output/kotlin.async-profiler.lock.current.jfr.md +1 -0
  168. package/examples/output/kotlin.async-profiler.lock.diff.jfr.md +1 -0
  169. package/examples/output/kotlin.async-profiler.nativemem.base.jfr.md +234 -0
  170. package/examples/output/kotlin.async-profiler.nativemem.current.jfr.md +234 -0
  171. package/examples/output/kotlin.async-profiler.nativemem.diff.jfr.md +65 -0
  172. package/examples/output/kotlin.async-profiler.wall.base.jfr.md +452 -0
  173. package/examples/output/kotlin.async-profiler.wall.current.jfr.md +457 -0
  174. package/examples/output/kotlin.async-profiler.wall.diff.jfr.md +125 -0
  175. package/examples/output/kotlin.jdk.all.base.jfr.md +1442 -0
  176. package/examples/output/kotlin.jdk.all.current.jfr.md +1343 -0
  177. package/examples/output/kotlin.jdk.all.diff.jfr.md +392 -0
  178. package/examples/output/kotlin.jdk.alloc.base.jfr.md +1418 -0
  179. package/examples/output/kotlin.jdk.alloc.current.jfr.md +1389 -0
  180. package/examples/output/kotlin.jdk.alloc.diff.jfr.md +383 -0
  181. package/examples/output/kotlin.jdk.cpu.base.jfr.md +1406 -0
  182. package/examples/output/kotlin.jdk.cpu.current.jfr.md +1374 -0
  183. package/examples/output/kotlin.jdk.cpu.diff.jfr.md +380 -0
  184. package/examples/output/kotlin.jdk.live.base.jfr.md +1378 -0
  185. package/examples/output/kotlin.jdk.live.current.jfr.md +1311 -0
  186. package/examples/output/kotlin.jdk.live.diff.jfr.md +381 -0
  187. package/examples/output/kotlin.jdk.lock.base.jfr.md +1427 -0
  188. package/examples/output/kotlin.jdk.lock.current.jfr.md +1374 -0
  189. package/examples/output/kotlin.jdk.lock.diff.jfr.md +386 -0
  190. package/examples/output/php.excimer.wall.base.speedscope.json.md +25 -0
  191. package/examples/output/php.excimer.wall.current.speedscope.json.md +25 -0
  192. package/examples/output/php.excimer.wall.diff.speedscope.json.md +29 -0
  193. package/examples/output/python.py-spy.cpu.base.collapsed.md +526 -0
  194. package/examples/output/python.py-spy.cpu.base.speedscope.json.md +37 -0
  195. package/examples/output/python.py-spy.cpu.current.collapsed.md +514 -0
  196. package/examples/output/python.py-spy.cpu.current.speedscope.json.md +37 -0
  197. package/examples/output/python.py-spy.cpu.diff.collapsed.md +122 -0
  198. package/examples/output/python.py-spy.cpu.diff.speedscope.json.md +31 -0
  199. package/examples/output/python.py-spy.wall.base.collapsed.md +527 -0
  200. package/examples/output/python.py-spy.wall.current.collapsed.md +518 -0
  201. package/examples/output/python.py-spy.wall.diff.collapsed.md +122 -0
  202. package/examples/output/ruby.rbspy.cpu.base.collapsed.md +90 -0
  203. package/examples/output/ruby.rbspy.cpu.base.pprof.md +105 -0
  204. package/examples/output/ruby.rbspy.cpu.base.speedscope.json.md +105 -0
  205. package/examples/output/ruby.rbspy.cpu.current.collapsed.md +90 -0
  206. package/examples/output/ruby.rbspy.cpu.current.pprof.md +115 -0
  207. package/examples/output/ruby.rbspy.cpu.current.speedscope.json.md +115 -0
  208. package/examples/output/ruby.rbspy.cpu.diff.collapsed.md +32 -0
  209. package/examples/output/ruby.rbspy.cpu.diff.pprof.md +44 -0
  210. package/examples/output/ruby.rbspy.cpu.diff.speedscope.json.md +44 -0
  211. package/examples/output/rust.pprof-rs.cpu.base.pprof.md +60 -0
  212. package/examples/output/rust.pprof-rs.cpu.current.pprof.md +60 -0
  213. package/examples/output/rust.pprof-rs.cpu.diff.pprof.md +24 -0
  214. package/package.json +27 -20
  215. package/readme.md +201 -87
  216. package/examples/bun.cpuprofile.md +0 -475
  217. package/examples/deno.cpuprofile.md +0 -481
  218. package/examples/jsc-heap-snapshot.json.md +0 -509
  219. package/examples/node.cpuprofile.md +0 -485
  220. package/examples/node.heapprofile.md +0 -281
  221. package/examples/node.heapsnapshot.md +0 -694
  222. package/examples/node.pprof.md +0 -441
  223. package/examples/node.speedscope.json.md +0 -408
  224. package/examples/rust.pprof.md +0 -477
  225. package/examples/webkit-timeline-recording.json.md +0 -434
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "profiler-md",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "author": {
5
5
  "name": "Tomer Aberbach",
6
6
  "email": "tomer@aberba.ch",
@@ -34,7 +34,10 @@
34
34
  "v8"
35
35
  ],
36
36
  "homepage": "https://github.com/TomerAberbach/profiler-md",
37
- "repository": "TomerAberbach/profiler-md",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "TomerAberbach/profiler-md"
40
+ },
38
41
  "bugs": {
39
42
  "url": "https://github.com/TomerAberbach/profiler-md/issues"
40
43
  },
@@ -43,7 +46,7 @@
43
46
  },
44
47
  "license": "MIT",
45
48
  "files": [
46
- "examples",
49
+ "examples/output",
47
50
  "dist",
48
51
  "docs"
49
52
  ],
@@ -64,45 +67,48 @@
64
67
  },
65
68
  "prettier": "@tomer/prettier-config",
66
69
  "dependencies": {
67
- "@optique/core": "^1.0.2",
68
- "@optique/run": "^1.0.2",
69
- "@shikijs/core": "^4.0.2",
70
- "@shikijs/engine-oniguruma": "^4.0.2",
71
- "@shikijs/langs": "^4.0.2",
72
- "@shikijs/themes": "^4.0.2",
73
- "ansis": "^4.3.0",
70
+ "@optique/core": "^1.1.0",
71
+ "@optique/run": "^1.1.0",
72
+ "@shikijs/core": "^4.2.0",
73
+ "@shikijs/engine-oniguruma": "^4.2.0",
74
+ "@shikijs/langs": "^4.2.0",
75
+ "@shikijs/themes": "^4.2.0",
76
+ "ansis": "^4.3.1",
74
77
  "convert-source-map": "^2.0.0",
75
78
  "globals": "^17.6.0",
76
79
  "jumbo-json": "^0.2.0",
80
+ "mdast-util-gfm-table": "^2.0.0",
81
+ "mdast-util-to-markdown": "^2.1.2",
77
82
  "picomatch": "^4.0.4",
78
83
  "plur": "^6.0.0",
79
- "pprof-format": "^2.2.1",
84
+ "pprof-format": "^2.2.2",
80
85
  "pretty-bytes": "^7.1.0",
81
86
  "pretty-ms": "^9.3.0",
82
87
  "source-map-js": "^1.2.1"
83
88
  },
84
89
  "devDependencies": {
85
- "@fast-check/vitest": "^0.4.0",
90
+ "@fast-check/vitest": "^0.4.1",
86
91
  "@rollup/plugin-terser": "^1.0.0",
87
- "@tomer/eslint-config": "^5.0.0",
92
+ "@tomer/eslint-config": "^5.1.1",
88
93
  "@tomer/prettier-config": "^4.0.1",
89
94
  "@types/convert-source-map": "^2.0.3",
90
95
  "@types/mdast": "^4.0.4",
91
96
  "@types/picomatch": "^4.0.3",
92
- "@vitest/coverage-v8": "^4.1.5",
97
+ "@vitest/coverage-v8": "^4.1.9",
93
98
  "dedent": "^1.7.2",
94
99
  "diff": "^9.0.0",
95
- "eslint": "^10.2.1",
96
- "jsdom": "^29.0.2",
100
+ "eslint": "^10.5.0",
101
+ "jsdom": "^29.1.1",
102
+ "limit-concur": "^4.0.0",
97
103
  "mdast-util-from-markdown": "^2.0.3",
98
104
  "mdast-util-gfm": "^3.1.0",
99
105
  "micromark-extension-gfm": "^3.0.0",
100
- "prettier": "^3.8.3",
101
- "publint": "^0.3.18",
106
+ "prettier": "^3.8.4",
107
+ "publint": "^0.3.21",
102
108
  "rollup-plugin-tree-shakeable": "^2.0.0",
103
- "tsdown": "^0.21.10",
109
+ "tsdown": "^0.22.2",
104
110
  "typescript": "^6.0.3",
105
- "vitest": "^4.1.5"
111
+ "vitest": "^4.1.9"
106
112
  },
107
113
  "scripts": {
108
114
  "format:base": "prettier --cache --write",
@@ -114,6 +120,7 @@
114
120
  "coverage": "vitest --coverage",
115
121
  "bench": "./scripts/bench",
116
122
  "build": "tsdown",
123
+ "generate-inputs": "./scripts/generate-inputs",
117
124
  "update-readme": "node scripts/update-readme.ts",
118
125
  "check-readme": "node scripts/update-readme.ts --check",
119
126
  "update-examples": "node scripts/update-examples.ts",
package/readme.md CHANGED
@@ -20,36 +20,125 @@
20
20
 
21
21
  > [!NOTE]
22
22
  >
23
- > This package is in a **beta** state and I'm excited for you to try it out!
23
+ > This package is in **beta** and I'm excited for you to try it!
24
24
  >
25
- > I'd love your feedback! Share any suggestions, bug reports, feature requests,
26
- > or general thoughts by
25
+ > I'd love your feedback! Share suggestions, bug reports, feature requests, or
26
+ > other thoughts by
27
27
  > [filing an issue](https://github.com/TomerAberbach/profiler-md/issues/new).
28
28
 
29
29
  ## Features
30
30
 
31
- - **Polyglot:** supports many formats across many languages
31
+ - **Polyglot:** supports many profile and heap snapshot formats across many
32
+ languages
33
+ - **Diffing:** compare two profiles or two heap snapshots to see what changed
34
+ - **Heap analysis:** reports self and retained size with dominator-based
35
+ retention for heap snapshots
36
+ - **Source maps:** resolves minified and transpiled locations back to original
37
+ sources
38
+ - **Zero config:** auto-detects the format, transparently decompresses
39
+ gzip/brotli, and reads from stdin
40
+ - **Readable in the terminal:** ANSI syntax highlighting with heat-map coloring
41
+ and automatic paging
32
42
  - **Configurable:** control the number of top entries shown, working directory
33
43
  for relative paths, third-party detection, and entry filtering
34
- - **CLI and API:** usable on the command-line or programmatically
44
+ - **CLI and API:** use it from the command line or programmatically
35
45
 
36
46
  ## Languages and formats
37
47
 
48
+ We list a format for a language only if its ecosystem's tools natively generate
49
+ it. Third-party tools can often convert others, though.
50
+
51
+ <!-- prettier-ignore-start -->
52
+
38
53
  <!-- LANGUAGE_MATRIX START -->
39
54
 
40
- | Language | Formats |
41
- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
42
- | [C](docs/languages/c.md)⁠/⁠[C++](docs/languages/cpp.md) | [pprof](docs/formats/pprof.md) |
43
- | [Go](docs/languages/go.md) | [pprof](docs/formats/pprof.md) |
44
- | [Java](docs/languages/java.md)⁠/⁠[Kotlin](docs/languages/kotlin.md) | [pprof](docs/formats/pprof.md)<br>[Speedscope](docs/formats/speedscope.md) |
45
- | [JavaScript](docs/languages/javascript.md)⁠/⁠[TypeScript](docs/languages/typescript.md) | [JSC heap snapshot](docs/formats/jsc-heap-snapshot.md) ([Safari](examples/jsc-heap-snapshot.json.md))<br>[pprof](docs/formats/pprof.md) ([Node.js](examples/node.pprof.md))<br>[Speedscope](docs/formats/speedscope.md) ([Node.js](examples/node.speedscope.json.md))<br>[V8 CPU profile](docs/formats/v8-cpu-profile.md) ([Node.js](examples/node.cpuprofile.md), [Deno](examples/deno.cpuprofile.md), [Bun](examples/bun.cpuprofile.md))<br>[V8 heap profile](docs/formats/v8-heap-profile.md) ([Node.js](examples/node.heapprofile.md))<br>[V8 heap snapshot](docs/formats/v8-heap-snapshot.md) ([Node.js](examples/node.heapsnapshot.md))<br>[WebKit timeline recording](docs/formats/webkit-timeline-recording.md) ([example](examples/webkit-timeline-recording.json.md)) |
46
- | [PHP](docs/languages/php.md) | [Speedscope](docs/formats/speedscope.md) |
47
- | [Python](docs/languages/python.md) | [pprof](docs/formats/pprof.md)<br>[Speedscope](docs/formats/speedscope.md) |
48
- | [Ruby](docs/languages/ruby.md) | [Speedscope](docs/formats/speedscope.md) |
49
- | [Rust](docs/languages/rust.md) | [pprof](docs/formats/pprof.md) ([example](examples/rust.pprof.md))<br>[Speedscope](docs/formats/speedscope.md) |
55
+ <table>
56
+ <thead>
57
+ <tr><th>Language</th><th>Formats</th></tr>
58
+ </thead>
59
+ <tbody>
60
+ <tr>
61
+ <td><a href="docs/languages/c.md">C</a>⁠/⁠<a href="docs/languages/cpp.md">C++</a></td>
62
+ <td>
63
+ <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>
64
+ </td>
65
+ </tr>
66
+ <tr>
67
+ <td><a href="docs/languages/csharp.md">C#</a>⁠/⁠<a href="docs/languages/fsharp.md">F#</a></td>
68
+ <td>
69
+ <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>
70
+ </td>
71
+ </tr>
72
+ <tr>
73
+ <td><a href="docs/languages/elixir.md">Elixir</a>⁠/⁠<a href="docs/languages/erlang.md">Erlang</a></td>
74
+ <td>
75
+ <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>
76
+ </td>
77
+ </tr>
78
+ <tr>
79
+ <td><a href="docs/languages/go.md">Go</a></td>
80
+ <td>
81
+ <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>
82
+ </td>
83
+ </tr>
84
+ <tr>
85
+ <td><a href="docs/languages/java.md">Java</a>⁠/⁠<a href="docs/languages/kotlin.md">Kotlin</a></td>
86
+ <td>
87
+ <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>
88
+ <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>
89
+ </td>
90
+ </tr>
91
+ <tr>
92
+ <td><a href="docs/languages/javascript.md">JavaScript</a>⁠/⁠<a href="docs/languages/typescript.md">TypeScript</a></td>
93
+ <td>
94
+ <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>
95
+ <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>
96
+ <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>
97
+ <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>
98
+ <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>
99
+ <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>
100
+ </td>
101
+ </tr>
102
+ <tr>
103
+ <td><a href="docs/languages/julia.md">Julia</a></td>
104
+ <td>
105
+ <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></ul></div>
106
+ </td>
107
+ </tr>
108
+ <tr>
109
+ <td><a href="docs/languages/php.md">PHP</a></td>
110
+ <td>
111
+ <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>
112
+ </td>
113
+ </tr>
114
+ <tr>
115
+ <td><a href="docs/languages/python.md">Python</a></td>
116
+ <td>
117
+ <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>
118
+ <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>
119
+ </td>
120
+ </tr>
121
+ <tr>
122
+ <td><a href="docs/languages/ruby.md">Ruby</a></td>
123
+ <td>
124
+ <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>
125
+ <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>
126
+ <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>
127
+ </td>
128
+ </tr>
129
+ <tr>
130
+ <td><a href="docs/languages/rust.md">Rust</a></td>
131
+ <td>
132
+ <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>
133
+ </td>
134
+ </tr>
135
+ </tbody>
136
+ </table>
50
137
 
51
138
  <!-- LANGUAGE_MATRIX END -->
52
139
 
140
+ <!-- prettier-ignore-end -->
141
+
53
142
  ## Install
54
143
 
55
144
  ```sh
@@ -66,30 +155,38 @@ $ npm i -g profiler-md
66
155
 
67
156
  ```sh
68
157
  $ profiler-md --help
69
- Usage: profiler-md [(-h/--help [TOPIC])] [-f/--format FORMAT] [-o/--output FILE]
70
- [--top-n N] [--cwd PATH] [--third-party GLOB...] [--source-maps GLOB...]
71
- [--no-pager] [(--color | --no-color)] [FILE]
158
+ Usage: profiler-md [(-h/--help [TOPIC])] [-f/--format FORMAT] [-r/--origin
159
+ ORIGIN] [-o/--output FILE] [--top-n N] [--base-url STRING] [--source-maps
160
+ GLOB...] [--match REGEX=REPLACEMENT...] [--third-party GLOB...] [
161
+ --no-pager] [(--color | --no-color)] ([FILE] | BASE CURRENT)
72
162
 
73
163
  Converts performance profiles to human and LLM friendly Markdown.
74
164
 
75
165
  -h, --help [TOPIC] Show this help message or topic docs
76
166
  -f, --format FORMAT Input profile format (default: auto)
167
+ -r, --origin ORIGIN Input profile origin (default: auto)
77
168
  -o, --output FILE Output file (default: - for stdout)
78
169
  --top-n N Number of top entries to show (default: 20)
79
- --cwd PATH Directory to show paths relative to (default: cwd)
80
- --third-party GLOB Additional URLs to consider third-party
81
- (repeatable)
170
+ --base-url STRING Base URL or path to show paths relative to
171
+ (default: cwd)
82
172
  --source-maps GLOB Source maps (JSON or inline) to apply to profile
83
173
  locations (repeatable)
174
+ --match REGEX=REPLACEMENT Treat locations matching REGEX as REPLACEMENT
175
+ when matching entries across diffed profiles
176
+ (repeatable)
177
+ --third-party GLOB Additional URLs or paths to consider third-party
178
+ (repeatable)
84
179
  --no-pager Disable stdout output paging (default: auto)
85
180
  --color Enable or disable ANSI syntax highlighting
86
181
  (default: auto)
87
182
  --no-color
88
- FILE Profile file to convert (reads from stdin if
89
- omitted)
183
+ FILE Profile to convert (reads from stdin if omitted)
184
+ BASE Base profile to diff
185
+ CURRENT Current profile to diff against the base
90
186
 
91
- Formats: jsc-heap-snapshot, pprof, speedscope, v8-cpu-profile, v8-heap-profile, v8-heap-snapshot, webkit-timeline-recording
92
- Languages: c, cpp, go, java, kotlin, javascript, typescript, php, python, ruby, rust
187
+ Formats: collapsed, jfr, jsc-heap-snapshot, pprof, speedscope, v8-cpu-profile, v8-heap-profile, v8-heap-snapshot, webkit-timeline-recording
188
+ Origins: beam, bun, deno, dotnet-trace, go, jvm, node, node-pprof, pprof-jl, pprof-rs, py-spy, rbspy, safari, tachyon, unknown
189
+ Languages: c, cpp, csharp, fsharp, elixir, erlang, go, java, kotlin, javascript, typescript, julia, php, python, ruby, rust
93
190
  ```
94
191
 
95
192
  <!-- CLI_HELP END -->
@@ -99,39 +196,68 @@ Languages: c, cpp, go, java, kotlin, javascript, typescript, php, python, ruby,
99
196
  ### API
100
197
 
101
198
  ```js
102
- import { openAsBlob } from 'node:fs'
199
+ import { openAsBlob, readFileSync } from 'node:fs'
103
200
  import {
104
- defaultCategorizeEntry,
201
+ defaultCategorizeEntries,
202
+ defaultMatchEntry,
105
203
  defaultShowEntry,
106
- pprofToMd,
107
- pprofToMdAsync,
108
- speedscopeProfileToMd,
109
- speedscopeProfileToMdAsync,
110
- v8CpuProfileToMd,
111
- v8CpuProfileToMdAsync,
112
- v8HeapProfileToMd,
113
- v8HeapProfileToMdAsync,
114
- v8HeapSnapshotToMd,
115
- v8HeapSnapshotToMdAsync,
116
- webkitTimelineRecordingToMd,
117
- webkitTimelineRecordingToMdAsync,
204
+ diffProfiles,
205
+ diffProfilesAsync,
206
+ profileToMd,
207
+ profileToMdAsync,
118
208
  } from 'profiler-md'
119
209
 
120
- // Basic usage
121
- console.log(await pprofToMdAsync(await openAsBlob(`example.pprof`)))
210
+ // Auto-detect format and origin (async)
211
+ console.log(await profileToMdAsync(await openAsBlob(`example.cpuprofile`)))
212
+ console.log(await profileToMdAsync(await openAsBlob(`example.pprof`)))
213
+
214
+ // Explicit format
122
215
  console.log(
123
- await speedscopeProfileToMdAsync(await openAsBlob(`example.speedscope.json`)),
216
+ await profileToMdAsync({
217
+ data: await openAsBlob(`example.pprof`),
218
+ format: `pprof`,
219
+ }),
124
220
  )
125
- console.log(await v8CpuProfileToMdAsync(await openAsBlob(`example.cpuprofile`)))
221
+ // Explicit origin
126
222
  console.log(
127
- await v8HeapProfileToMdAsync(await openAsBlob(`example.heapprofile`)),
223
+ await profileToMdAsync({
224
+ data: await openAsBlob(`example.cpuprofile`),
225
+ origin: `deno`,
226
+ }),
128
227
  )
228
+
229
+ // Synchronous usage (auto-detect)
230
+ console.log(profileToMd(readFileSync(`example.cpuprofile`, `utf8`)))
231
+ console.log(profileToMd(readFileSync(`example.pprof`)))
232
+
233
+ // Synchronous usage with explicit format and origin
234
+ console.log(
235
+ profileToMd({
236
+ data: readFileSync(`example.pprof`),
237
+ format: `pprof`,
238
+ origin: `node-pprof`,
239
+ }),
240
+ )
241
+
242
+ // Diff two profiles or two heap snapshots (async, auto-detect)
129
243
  console.log(
130
- await v8HeapSnapshotToMdAsync(await openAsBlob(`example.heapsnapshot`)),
244
+ await diffProfilesAsync(
245
+ await openAsBlob(`base.cpuprofile`),
246
+ await openAsBlob(`current.cpuprofile`),
247
+ ),
248
+ )
249
+ console.log(
250
+ await diffProfilesAsync(
251
+ await openAsBlob(`base.heapsnapshot`),
252
+ await openAsBlob(`current.heapsnapshot`),
253
+ ),
131
254
  )
255
+
256
+ // Synchronous diff with explicit format
132
257
  console.log(
133
- await webkitTimelineRecordingToMdAsync(
134
- await openAsBlob(`example.webkit-timeline-recording.json`),
258
+ diffProfiles(
259
+ { data: readFileSync(`base.pprof`), format: `pprof` },
260
+ { data: readFileSync(`current.pprof`), format: `pprof` },
135
261
  ),
136
262
  )
137
263
 
@@ -139,56 +265,44 @@ console.log(
139
265
  const options = {
140
266
  // Show top 10 functions instead of the default 20.
141
267
  topN: 10,
142
- // Make paths relative to a custom directory.
143
- cwd: `/path/to/project`,
144
- categorizeEntry: entry => {
145
- if (entry.location?.url.pathname.includes(`/vendor/`)) {
146
- // Treat an additional vendor directory as third-party.
147
- return `third-party`
268
+ // Make paths relative to a custom base URL or directory.
269
+ baseURL: `/path/to/project`,
270
+ matchEntry: entry => {
271
+ if (entry.location?.url.pathname.includes(`/bundle.`)) {
272
+ // Match bundled entries when diffing by name only, ignoring
273
+ // content-hashed filenames.
274
+ return { name: entry.name }
148
275
  }
149
- return defaultCategorizeEntry(entry)
276
+ return defaultMatchEntry(entry)
277
+ },
278
+ categorizeEntries: (entries, context) => {
279
+ const categories = defaultCategorizeEntries(entries, context)
280
+ return entries.map((entry, index) =>
281
+ // Treat an additional vendor directory as third-party.
282
+ entry.location?.url?.pathname.includes(`/vendor/`)
283
+ ? `third-party`
284
+ : categories[index],
285
+ )
150
286
  },
151
287
  showEntry: entry =>
152
288
  defaultShowEntry(entry) &&
153
289
  // Exclude entries from a specific file.
154
290
  !entry.location?.includes(`/path/to/project/src/noisy`),
155
291
  }
156
- console.log(await pprofToMdAsync(await openAsBlob(`example.pprof`), options))
157
- console.log(
158
- await speedscopeProfileToMdAsync(
159
- await openAsBlob(`example.speedscope.json`),
160
- options,
161
- ),
162
- )
163
- console.log(
164
- await v8CpuProfileToMdAsync(await openAsBlob(`example.cpuprofile`), options),
165
- )
292
+ console.log(await profileToMdAsync(await openAsBlob(`example.pprof`), options))
166
293
  console.log(
167
- await v8HeapProfileToMdAsync(
168
- await openAsBlob(`example.heapprofile`),
169
- options,
170
- ),
171
- )
172
- console.log(
173
- await v8HeapSnapshotToMdAsync(
174
- await openAsBlob(`example.heapsnapshot`),
175
- options,
176
- ),
294
+ await profileToMdAsync(await openAsBlob(`example.cpuprofile`), options),
177
295
  )
296
+
297
+ // The same options also apply to diffs. `matchEntry` only takes effect here,
298
+ // where it controls which entries are considered the same across the two sides.
178
299
  console.log(
179
- await webkitTimelineRecordingToMdAsync(
180
- await openAsBlob(`example.webkit-timeline-recording.json`),
300
+ await diffProfilesAsync(
301
+ await openAsBlob(`base.pprof`),
302
+ await openAsBlob(`current.pprof`),
181
303
  options,
182
304
  ),
183
305
  )
184
-
185
- // Synchronous usage
186
- console.log(pprofToMd(pprofData))
187
- console.log(speedscopeProfileToMd(speedscopeProfileData))
188
- console.log(v8CpuProfileToMd(v8CpuProfileData))
189
- console.log(v8HeapProfileToMd(v8HeapProfileData))
190
- console.log(v8HeapSnapshotToMd(v8HeapSnapshotData))
191
- console.log(webkitTimelineRecordingToMd(webkitTimelineRecordingData))
192
306
  ```
193
307
 
194
308
  ## Shell completions
@@ -212,7 +326,8 @@ $ profiler-md --completion pwsh >> $PROFILE.CurrentUserCurrentHost
212
326
 
213
327
  ## Skills
214
328
 
215
- Use this `profiler-md` skill to have an agent profile and optimize your code:
329
+ Use the [`profiler-md` skill](./skills/profile-optimize/SKILL.md) to have an
330
+ agent profile and optimize your code:
216
331
 
217
332
  ```sh
218
333
  $ npx skills add TomerAberbach/profiler-md --skill profile-optimize
@@ -220,8 +335,7 @@ $ npx skills add TomerAberbach/profiler-md --skill profile-optimize
220
335
 
221
336
  See [skills.sh](https://skills.sh/docs) for more info.
222
337
 
223
- Fun fact: the skill has been used to profile and optimize `profiler-md` using
224
- itself!
338
+ Fun fact: the skill has profiled and optimized `profiler-md` itself!
225
339
 
226
340
  ## Contributing
227
341