🔬 A fast, interactive web-based viewer for performance profiles.
Go to file
Jamie Wong 4e32a73802
Fix existing code splitting & code split profile importers into their own chunk (#79)
At some point in the past, the code splitting of demangle-cpp got broken. This fixes that and also code splits out all fo the different profile importers into their own module since they aren't needed for initial render of the page.
2018-06-30 17:26:28 -07:00
.vscode Add a hotkey to flatten recursion (#68) 2018-06-21 13:56:58 -07:00
import Fix existing code splitting & code split profile importers into their own chunk (#79) 2018-06-30 17:26:28 -07:00
sample Add a hotkey to flatten recursion (#68) 2018-06-21 13:56:58 -07:00
.eslintrc.js Set up Prettier and run it on the whole codebase 2018-04-14 08:40:06 -07:00
.gitignore Add test coverage reporting (#55) 2018-05-29 19:59:04 -07:00
.npmignore Setup for publish 2018-05-31 00:24:24 -07:00
.travis.yml Set up Prettier and run it on the whole codebase 2018-04-14 08:40:06 -07:00
application.tsx Fix existing code splitting & code split profile importers into their own chunk (#79) 2018-06-30 17:26:28 -07:00
asm-js.test.ts Add support for dropping asm.js symbol maps (#76) 2018-06-25 15:53:08 -07:00
asm-js.ts Add support for dropping asm.js symbol maps (#76) 2018-06-25 15:53:08 -07:00
canvas-context.ts Fix typo in file name 2018-04-18 21:44:39 -07:00
cli.js Setup for publish 2018-05-31 00:24:24 -07:00
color-chit.tsx Introduce a simple table view (#59) 2018-06-18 12:11:04 -07:00
color.ts Add a detail view to view aggregate statistics & file details (#23) 2018-04-17 00:04:24 -07:00
demangle-cpp.ts Set up Prettier and run it on the whole codebase 2018-04-14 08:40:06 -07:00
deploy.sh Set the CNAME record in the deploy 2018-05-09 00:00:28 -07: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-color-pass-renderer.ts Address review comments 2018-04-14 16:19:26 -07:00
flamechart-detail-view.tsx Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
flamechart-minimap-view.tsx Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
flamechart-pan-zoom-view.tsx Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
flamechart-renderer.ts Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
flamechart-style.ts Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
flamechart-view.tsx Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
flamechart.ts Add a hotkey to flatten recursion (#68) 2018-06-21 13:56:58 -07:00
hash-params.ts Add profileURL and title hash parameters (#19) 2018-04-14 20:38:04 -07:00
hovertip.tsx Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
index.html Switch to Source Code Pro, tweak outlines (#48) 2018-05-29 13:32:39 -07:00
LICENSE Add MIT License 2018-04-08 22:35:53 -07:00
lru-cache.test.ts Add test for LRU cache (#53) 2018-05-29 18:18:45 -07:00
lru-cache.ts Address review comments 2018-04-14 16:19:26 -07:00
math.test.ts Add tests for Vec2, Rect, and AffineTransform (#52) 2018-05-29 17:05:04 -07:00
math.ts Add tests for Vec2, Rect, and AffineTransform (#52) 2018-05-29 17:05:04 -07:00
overlay-rectangle-renderer.ts Address review comments 2018-04-14 16:19:26 -07:00
package-lock.json Upgrade parcel-bundler to 1.9.2 2018-06-30 15:44:46 -07:00
package.json Upgrade parcel-bundler to 1.9.2 2018-06-30 15:44:46 -07:00
prettier.config.js Address review comments 2018-04-14 16:19:26 -07:00
profile-table-view.tsx Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
profile.test.ts Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
profile.ts Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
README.md Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
rectangle-batch-renderer.ts Address review comments 2018-04-14 16:19:26 -07:00
regl.d.ts Address review comments 2018-04-14 16:19:26 -07:00
reloadable.tsx Address review comments 2018-04-14 16:19:26 -07:00
reset.css Minimap viewport rectangle border 2017-12-26 18:02:00 -05:00
row-atlas.ts Add a hotkey to flatten recursion (#68) 2018-06-21 13:56:58 -07:00
sandwich-view.tsx Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
scrollable-list-view.tsx Introduce a simple table view (#59) 2018-06-18 12:11:04 -07:00
speedscope.tsx Address review comments 2018-04-14 16:19:26 -07:00
stats.ts Set up Prettier and run it on the whole codebase 2018-04-14 08:40:06 -07:00
style.ts Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
test-utils.ts Fix existing code splitting & code split profile importers into their own chunk (#79) 2018-06-30 17:26:28 -07:00
text-utils.ts Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
texture-cached-renderer.ts Fix typo in file name 2018-04-18 21:44:39 -07:00
tsconfig.json Fix existing code splitting & code split profile importers into their own chunk (#79) 2018-06-30 17:26:28 -07:00
utils.test.ts Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
utils.ts Upgrade the "Table view" to a "Sandwich" view (#73) 2018-06-29 12:06:19 -07:00
value-formatters.test.ts Introduce a simple table view (#59) 2018-06-18 12:11:04 -07:00
value-formatters.ts Introduce a simple table view (#59) 2018-06-18 12:11:04 -07:00

🔬speedscope

A fast, interactive web-based viewer for sampling profiles. An alternative viewer for FlameGraphs. Will happily display multi-megabyte profiles without crashing your browser.

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

Chrome

Both the timeline format output by Chrome developers tools (https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference#save) and the .cpuprofile format output are supported. The .cpuprofile format is useful for viewing flamecharts generated by Node.js applications: https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27

Firefox

The profile.json file format output by Firefox can be saved and import into speedscope: https://developer.mozilla.org/en-US/docs/Tools/Performance

Instruments.app

You can import call trees from OSX Instruments.app into speedscope by selecting a row in the "Profile" view and select "Edit -> Deep Copy" from the menu then pasting directly into speedscope. This data contains only aggregate statistics, so the "Time Order" view and the "Left Heavy" view will look very similar.

You can also import .trace files for time profiles by dragging them directly into the browser from Chrome.

stackprof Ruby profiler

If the raw: true flag is set when recording a dump, the resulting json dump can be imported into speedscope.

perf and DTrace

If you process the output of perf or DTrace first with Brendan Gregg's stackcollapse-*.pl scripts (https://github.com/brendangregg/FlameGraph#2-fold-stacks), the result can be imported into speedscope.

Importing via URL

To load a specific profile by URL, you can append a hash fragment like #profileURL=[URL-encoded profile URL]&title=[URL-encoded custom title]. Note that the server hosting the profile must have CORS configured to allow AJAX requests from speedscope.

Views

🕰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.

In all flamegraph views, 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.

If you click on one of the frames, you'll be able to see summary statistics about it.

Detail View

⬅️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.

🥪 Sandwich

The Sandwich view is a table view in which you can find a list of all functions an their associated times. You can sort by self time or total time. It's called "Sandwich" view because if you select one of the rows in the table, you can see flamegraphs for all the callers and callees of the selected row.

Sandwich View

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
  • Double click on a frame to fit the viewport to it
  • Click on a frame to view summary statistics about it

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
  • 3: Switch to the "Sandwich" view
  • r: Collapse recursion in the flamegraphs