Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

speedscope

jlfwong55.9kMIT1.23.1

English | 简体中文 # 🔬speedscope A fast, interactive web-based viewer for performance profiles. Supports import from a variety of profiles in a variety of languages (JS, Ruby, Python, Go & more). Try it here: https://www.speedscope.app

readme

English | 简体中文

🔬speedscope

A fast, interactive web-based viewer for performance profiles. Supports import from a variety of profiles in a variety of languages (JS, Ruby, Python, Go & more). Try it here: https://www.speedscope.app

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

Supported file formats

speedscope is designed to ingest profiles from a variety of different profilers for different programming languages & environments. Click the links below for documentation on how to import from a specific source.

Contributions to add support for additional formats are welcome! See issues with the "import source" tag.

Usage

Visit https://www.speedscope.app, 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.

Command line usage

For offline use, or convenience in the terminal, you can also install speedscope via npm:

npm install -g speedscope

Invoking speedscope /path/to/profile will load speedscope in your default browser.

Self-contained directory

If you don't have npm or node installed, you can also download a self-contained version from https://github.com/jlfwong/speedscope/releases. After you download the zip file from a release, simply unzip it and open the contained index.html in Chrome or Firefox.

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

Detail View

In the "Time Order" view (the default), call stacks are ordered left-to-right in the same order as they occurred in the input file, which is usually going to be the chronological order they were recorded in. This view is most helpful for understanding 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".

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.

⬅️Left Heavy

Left Heavy View

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

Sandwich View

The Sandwich view is a table view in which you can find a list of all functions and 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.

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
  • Cmd+S/Ctrl+S to save the current profile
  • Cmd+O/Ctrl+O to open a new profile
  • n: Go to next profile/thread if one is available
  • p: Go to previous profile/thread if one is available
  • t: Open the profile/thread selector if available
  • Cmd+F/Ctrl+F: to open search. While open, Enter and Shift+Enter cycle through results

Contributing

Do you want to contribute to speedscope? Sweeeeet. Check out CONTRIBUTING.md for instructions on setting up your dev environment.

changelog

[1.23.1] - 2025-08-11

  • Profile selector: add sortable columns and total weight display [#515] (by @jlfwong)

[1.23.0] - 2025-07-06

  • Add support for FreeBSD's pmcstat callgraph format [#502] (by @ryan-moeller)

[1.22.2] - 2025-02-15

  • 1.22.1
  • Update to working open, switch to ESM [#499] (by @flying-sheep)
  • Revert "Fix broken CLI dependency open" [#498] (by @flying-sheep)
  • Fix broken CLI dependency open [#498] (by @flying-sheep)
  • Update README.md [#496] (by @dkuku)

[1.22.1] - 2025-02-15

  • Update to working open, switch to ESM [#499] (by @flying-sheep)
  • Revert "Fix broken CLI dependency open" [#498] (by @flying-sheep)
  • Fix broken CLI dependency open [#498] (by @flying-sheep)
  • Update README.md [#496] (by @dkuku)

[1.22.0] - 2025-01-16

  • Add an example trace with rust mangling
  • Add support for Rust v0 symbol mangling scheme [#491] (by @cerisier)

[1.21.2] - 2025-01-15

  • Switch from parcel to esbuild [#432] (by @jlfwong)
  • Revert "Upgrade to parcel 2.13.3" [#492] (by @jlfwong)
  • Upgrade to parcel 2.13.3 [#492] (by @jlfwong)
  • Add link to async-profiler wiki page to README

[1.21.0] - 2024-11-16

  • Add support for Instruments 16 Time Profile Deep Copy [#484] (by @robert3005)
  • Fix bug where import after error continues failing [#463] (by @tom93)
  • Bundle the font [#472] (by @Krinkle)
  • Clarify specification of startValue in speedscope file format [#464] (by @tom93)

[1.20.0] - 2024-01-12

  • Partition based on samples instead of traceEvents when importing a sample-based chrome trace [#460] (by @zacharyfmarion)

[1.19.0] - 2023-12-27

  • Improve hermes profile frame keys to better group frames [#459] (by @zacharyfmarion)
  • Update README.md

[1.18.0] - 2023-12-26

  • Add hermes-specific support for the trace event format [#458] (by @zacharyfmarion)
  • Update README-ADMINS.md with npm login instructions [#457] (by @jlfwong)

[1.17.0] - 2023-12-25

  • Upgrade prettier, update prettier & react-hooks eslint plugins [#456] (by @jlfwong)
  • Upgrade typescript & eslint to latest, fix resulting errors [#455] (by @jlfwong)
  • Re-enable eslint prettier rule after being accidentally disabled for 3 years [#454] (by @jlfwong)
  • Support the chrome JSON trace format (allows viewing of hermes traces) [#453] (by @zacharyfmarion)
  • Fix bug in selectQueueToTakeFromNext for trace profiles [#450] (by @zacharyfmarion)
  • Add bounds checking for sampleTypeIndex [#449] (by @jlfwong)
  • Update README-zh_CN.md [#442] (by @byronhe)
  • Update publish-and-deploy to remove automated release creation [#440] (by @jlfwong)

[1.16.0] - 2023-07-16

  • Automate more of the release process [#439] (by @jlfwong)
  • Improve profile builder performance [#437] (by @Goose97)
  • Fix crash when importing big linux perf tool files [#435] (by @Goose97)
  • Improve splitLines: return iterator instead [#434] (by @Goose97)
  • Fix trimTextMid [#431] (by @jlfwong)
  • Added support for Papyrus profiles [#428] (by @xieve)

[1.15.2] - 2023-06-21

Fixed

  • Use more accurate line information for pprof profiles [#430] (by @dalehamel)
  • Stackprof: weight on-cpu samples by period rather than timestamp delta [#425] (by @manuelfelipe)
  • Prevent crashes when stackprof profiles frames are missing names [#419] (by @jez)
  • fix pprof defaultSampleType [#424] (by @vasi-stripe)

[1.15.1] - 2023-06-04

Fixed

  • Fix import from Chrome Devtools performance tab in Chrome >= 114 [#422]
  • Callgrind: Subposition compression and weight correction [#423]

[1.15.0] - 2022-10-22

Fixed

  • Replace fuzzy matching with exact substring matching for finding matching frames [#407]

[1.14.0] - 2022-05-19

Added

  • File and line information is now displayed in hover tips [#365] (by @sokra)
  • Support for stackprof object mode [#391] (by @alexcoco)
  • Support for hash params to control view-mode [#362] (by @djudd)
  • Support for profiles over 512MB now works [#385] (by @jlfwong)
  • Support for relative URLs in profileURL hashParam [#357] (by @danvk)

Fixed

  • Allow collapsed stacks with invalid lines for the Brenden Gregg stack format [#336] (by @P403n1x87)
  • Allow pasting into the search box [#338] (by @P403n1x87)
  • Prevent hover tips from getting unnecessarily clipped outside container bounds [#395] (by @jlfwong)

[1.13.0] - 2021-02-14

Added

  • Support for importing callgrind profiles [#331]

[1.12.1] - 2020-11-12

Fixed

  • Fixed for retina displays [#327]

[1.12.0] - 2020-11-12

Added

Fixed

  • Fixed incorrect highlighting when search result overlaps "…" [#326]

[1.11.1] - 2020-10-25

Fixed

  • Fix trace-event import for many cases where there are 'ts' collisions [#322]
  • Fix import of trace event files where B/E events' args don't match [#321]

[1.11.0] - 2020-10-13

Added

  • Support remapping profiles using source maps [#317]

Fixed

  • Fix line & column numbers in imports from Chrome & Firefox [#318]

[1.10.0] - 2020-09-29

Added

  • Support for importing profiles from Safari [#300] (by @radex)

Fixed

  • Fixed browser not opening on Windows when using the CLI [#307] (by @spillerrec)
  • Fixed import of UTF-16 encoded files w/ BOM [#314]
  • Removed accidental dependency on React [#315]

[1.9.0] - 2020-08-05

Added

  • Provide prev/next buttons to cycle through search results, make search results more visually prominen [#304]

Fixed

  • Fix accumulated errors in Chrome profile imports caused by zeroed negative timeDeltas [#305] (by @taneliang)

[1.8.0] - 2020-07-19

Added

  • Added search highlighting in time order & left heavy views [#297]

Fixed

  • Fix performance issues for the caller/callee flamegraphs in the sandwich view [#296]

[1.7.0] - 2020-07-13

Added

  • Introduced filtering via Ctrl+F/Cmd+F into the sandwich view [#293]

[1.6.0] - 2020-05-30

Added

  • Improved profile/thread selection UI [#282]

Fixed

  • Crash instead of incorrectly interpreting profiles with incorrectly ordered events [#273]
  • A large refactor to upgrade to Preact X was performed [#267]

[1.5.3] - 2020-01-16

Fixed

[1.5.2] - 2019-10-10

Fixed

  • Fix emscripten remapping when symbols are hex-escaped, like a\20b [#233] (by @jyc)

[1.5.1] - 2019-06-06

Fixed

  • Fixed import of trace event files which contain unmatched "E" events (#222) (by @jlfwong)

[1.5.0] - 2019-02-17

Added

  • Support importing unterminated JSON in simple cases (#208) (by @jlfwong)

Fixed

  • Fix crash when importing from stackprof without raw_timestamp_deltas (#207) (by @jlfwong)
  • Alert instead of crash when importing a file containing no profiles (#205) (by @jlfwong)
  • Fixed import of multithreaded profiles from Chrome 66 (#206) (by @jlfwong)
  • Fixed import of instruments trace files with missing run number (#203) (by @Archerlly)

[1.4.1] - 2019-01-22

Fixed

  • Fix importing of Trace Event Format files with no ts field on M events [#198] (by @jlfwong)

[1.4.0] - 2019-01-22

Added

[1.3.2] - 2018-12-03

Fixed

  • Fixed import of multithreaded Chrome profiles [#19] (by @jlfwong)

[1.3.1] - 2018-11-08

Fixed

  • Fixed a file import performance regression by using TextDecoder [#188] (by @jlfwong)

[1.3.0] - 2018-10-29

Added

  • Support import from Haskell GHC JSON format support [#183] (by @trishume)

Fixed

  • Make the wasd keymappings work on azerty keyboards [#184] (by @vrischmann)
  • Fix import of binary formats via profileURL [#179] (by @f-hj)

[1.2.0] - 2018-10-08

Added

[1.1.0] - 2018-09-26

Added

  • Add go tool pprof import support [#165]

[1.0.4] - 2018-09-12

Fixed

  • Fix import from Chrome < 69 when there are multiple profiles [#161]

[1.0.3] - 2018-09-10

Fixed

  • Fix import for Chrome 69, support leading idle time before first call [#160]

[1.0.2] - 2018-09-04

Fixed

  • Allow optional CR before LF when probing collapsed stacks files [#154]
  • Fix import for Firefox 63 [#156]
  • Change time formatting for minutes from 1.50min to 1:30 [#153] (by @Alex-Diez)

[1.0.1] - 2018-08-23

  • Fixed an issue where flamegraph bounds were not always being cleared correctly, leading to visual artifacts [#150]

[1.0.0] - 2018-08-23

Fixed

  • Fixed rendering issues when switching between screens w/ different devicePixelRatios [#147]

[0.7.1] - 2018-08-20

Fixed

  • Removed dependency on regl in order to allow speedscope to run in strict content-security-policy environments [#140]
  • Fixed text culling bug [#143]

[0.7.0] - 2018-08-16

Added

  • Added support to import from linux perf script [#135]

[0.6.0] - 2018-08-14

Added

  • Added support for multiple threads/processes [#130]
  • Import all runs & threads from Instruments .trace files instead of just main thread from selected run [#130]

Fixed

  • Ensure the JSON schema has actual contents [#133]

[0.5.1] - 2018-08-09

Fixed

  • Fixed broken CLI

[0.5.0] - 2018-08-09

Fixed

  • Fix emscripten remapping when symbols contain dashes, like 527:i32s-div [#129]
  • Improved firefox import speed and fixed bugs in it [#128]
  • Prevent non-contiguous blocks in the time ordered flamechart from appearing as a single node for selection [#123]
  • Prevent dragging from changing selection [#122]
  • Clamp zoom to prevent floating point issues [#121]
  • Preserve view state when switching tabs [#100]

[0.4.0] - 2018-07-21

Added

  • Support for importing v8 logs from node [#98]
  • Optionally read from stdin via cli [#99]

[0.3.0] - 2018-07-18

Added

  • Support for remapping profiles using a wasm symbol file [#93]