🔬 A fast, interactive web-based viewer for performance profiles.
Go to file
2018-01-16 22:38:11 -08:00
dist release 2018-01-16 10:00:18 -08:00
import Faster chrome import by de-duplicating FrameInfo 2018-01-16 22:38:11 -08:00
sample Add sucrase cpuprofile as a sample 2018-01-08 22:38:18 -08:00
.gitignore Basic landing page 2018-01-07 11:45:05 -08:00
aphrodite.d.ts Switch to browserify for better iteration time 2017-12-14 00:30:35 -08:00
application.tsx Add utils, time import more granularly 2018-01-16 22:27:31 -08:00
color.ts Speed up color genration 2018-01-07 18:36:23 -08:00
dev.html Favicon 2018-01-07 08:36:11 -08:00
favicon-16x16.png Favicon 2018-01-07 08:36:11 -08:00
favicon-32x32.png Favicon 2018-01-07 08:36:11 -08:00
favicon.ico Favicon 2018-01-07 08:36:11 -08:00
flamechart-minimap-view.tsx Zoom by scrolling on minimap 2018-01-10 22:25:58 -08:00
flamechart-style.ts Fix weird resize issues 2017-12-29 22:07:41 -05:00
flamechart-view.tsx Add utils, time import more granularly 2018-01-16 22:27:31 -08:00
flamechart.ts Speed up color genration 2018-01-07 18:36:23 -08:00
index.html Fix favicon URL 2018-01-13 21:05:58 -08:00
math.ts Optimize overlay rendering by reducing number of allocations 2018-01-08 22:37:39 -08:00
package-lock.json Batch rectangle renderer with regl 2017-11-22 19:19:10 -08:00
package.json Basic landing page 2018-01-07 11:45:05 -08:00
profile.ts Toolbar changes 2018-01-07 16:18:41 -08:00
README.md Update docs 2018-01-07 19:53:36 -08:00
rectangle-batch-renderer.ts release 2018-01-08 22:39:10 -08:00
regl.d.ts Optimize rectangleBatchRenderer construction 2018-01-08 22:02:20 -08:00
reloadable.tsx Hotloading tweaks, frame rectangle stroke 2017-12-26 11:49:25 -05:00
reset.css Minimap viewport rectangle border 2017-12-26 18:02:00 -05:00
speedscope.tsx Hot reloading WIP 2017-12-23 13:37:56 -05:00
style.ts Toolbar changes 2018-01-07 16:18:41 -08:00
tsconfig.json Switch to browserify for better iteration time 2017-12-14 00:30:35 -08:00
utils.ts Faster chrome import by de-duplicating FrameInfo 2018-01-16 22:38:11 -08:00

🔬speedscope

An interactive web-based viewer for sampling profiles. An alternative viewer for FlameGraphs.

Given raw profiling data, speedscope allows you to interactively explore the data to get insight into what's slow in your application, or allocating all the memory, or whatever data is represented in the profiling data.

Example Profile

Usage

Visit https://jlfwong.github.io/speedscope/, then either browse to find a profile file or drag-and-drop one onto the page. The profiles are not uploaded anywhere -- the application is totally in-browser.

Supported file formats:

  1. The folded stack format output by the FlameGraph scripts do: https://github.com/brendangregg/FlameGraph#2-fold-stacks. Example: https://github.com/jlfwong/speedscope/blob/master/sample/perf-vertx-stacks-01-collapsed-all.txt
  2. The timeline format output by Chrome developer tools: https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference#save. NOTE: You must append a .json extension. Example: https://github.com/jlfwong/speedscope/blob/master/sample/chrome-timeline.json
  3. The .cpuprofile format output by Chrome developer tools JavaScript profiler, useful for viewing flamecharts generated by Node.js applications: https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27

Views

Both of the main views of the applications display flame graphs.

In this view, the horizontal axis represents the "weight" of each stack (most commonly CPU time), and the vertical axis shows you the stack active at the time of the sample.

🕰Time Order

In the "Time Order" view (the default), the stacks are ordered left-to-right in the same order as the occurred in the input file, which is usually going to be the chronological order they were recorded in. This view is most helpful for understand the behavior of an application over time, e.g. "first the data is fetched from the database, then the data is prepared for serialization, then the data is serialized to JSON". This is the only flame graph order supported by Chrome developer tools.

⬅️Left Heavy

In the "Left Heavy" view, identical stacks are grouped together, regardless of whether they were recorded sequentially. Then, the stacks are sorted so that the heaviest stack for each parent is on the left -- hence "left heavy". This view is useful for understanding where all the time is going in situations where there are hundreds or thousands of function calls interleaved between other call stacks.

Navigation

Once a profile has loaded, the main view is split into two: the top area is the "minimap", and the bottom area is the "stack view".

Minimap Navigation

  • Scroll on either axis to pan around
  • Click and drag to narrow your view to a specific range

Stack View Navigation

  • Scroll on either axis to pan around
  • Pinch to zoom
  • Hold Cmd+Scroll to zoom

Keyboard Navigation

  • +: zoom in
  • -: zoom out
  • 0: zoom out to see the entire profile
  • w/a/s/d or arrow keys: pan around the profile
  • 1: Switch to the "Time Order" view
  • 2: Switch to the "Left Heavy" view