Skip to content

Commit c99a055

Browse files
committed
add speedscope widget api & diff mode
See README.md
1 parent 3613918 commit c99a055

72 files changed

Lines changed: 12476 additions & 8071 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README-ORI.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
English | [简体中文](./README-zh_CN.md)
2+
# 🔬speedscope
3+
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
4+
5+
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.
6+
7+
![Example Profile](https://user-images.githubusercontent.com/150329/40900669-86eced80-6781-11e8-92c1-dc667b651e72.gif)
8+
9+
[0]: https://en.wikipedia.org/wiki/Profiling_(computer_programming)#Statistical_profilers
10+
[1]: https://github.com/brendangregg/FlameGraph
11+
12+
# Supported file formats
13+
14+
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.
15+
16+
- JavaScript
17+
- [Importing from Chrome](https://github.com/jlfwong/speedscope/wiki/Importing-from-Chrome)
18+
- [Importing from Firefox](https://github.com/jlfwong/speedscope/wiki/Importing-from-Firefox)
19+
- [Importing from Safari](https://github.com/jlfwong/speedscope/wiki/Importing-from-Safari)
20+
- [Importing from Node.js](https://github.com/jlfwong/speedscope/wiki/Importing-from-Node.js)
21+
- [Importing from Hermes (for React Native)](https://github.com/jlfwong/speedscope/wiki/Importing-from-Hermes)
22+
- Ruby
23+
- [Importing from stackprof](https://github.com/jlfwong/speedscope/wiki/Importing-from-stackprof-(ruby))
24+
- [Importing from rbspy](https://github.com/jlfwong/speedscope/wiki/Importing-from-rbspy-(ruby))
25+
- [Importing from ruby-prof](https://github.com/jlfwong/speedscope/wiki/Importing-from-ruby-prof)
26+
- Python
27+
- [Importing from py-spy](https://github.com/jlfwong/speedscope/wiki/Importing-from-py-spy-(python))
28+
- [pyspeedscope](https://github.com/windelbouwman/pyspeedscope)
29+
- [Importing from Austin](https://github.com/P403n1x87/austin-python#format-conversion)
30+
- [Importing from pyinstrument](https://github.com/jlfwong/speedscope/wiki/Importing-from-pyinstrument-(python))
31+
- PHP
32+
- [Importing from phpspy or sj-i/php-profiler](https://github.com/sj-i/php-profiler/pull/101)
33+
- Go
34+
- [Importing from pprof](https://github.com/jlfwong/speedscope/wiki/Importing-from-pprof-(go))
35+
- Rust
36+
- [flamescope](https://github.com/coolreader18/flamescope)
37+
- Java
38+
- [Importing from async‐profiler (Java)
39+
](https://github.com/jlfwong/speedscope/wiki/Importing-from-async%E2%80%90profiler-(Java))
40+
- [Importing from Java Flight Recorder](https://github.com/jlfwong/speedscope/wiki/Importing-from-Java-Flight-Recorder)
41+
- Erlang/Elixir
42+
- [eflambe](https://github.com/Stratus3D/eflambe)
43+
- Native code
44+
- [Importing from Instruments.app](https://github.com/jlfwong/speedscope/wiki/Importing-from-Instruments.app) (macOS)
45+
- [Importing from `perf`](https://github.com/jlfwong/speedscope/wiki/Importing-from-perf-(linux)) (linux)
46+
- [Importing from .NET Core](https://github.com/jlfwong/speedscope/wiki/Importing-from-.NET-Core)
47+
- [Importing from GHC (Haskell)](https://github.com/jlfwong/speedscope/wiki/Importing-from-Haskell)
48+
- [Importing from custom sources](https://github.com/jlfwong/speedscope/wiki/Importing-from-custom-sources)
49+
50+
Contributions to add support for additional formats are welcome! See issues with the ["import source" tag](https://github.com/jlfwong/speedscope/issues?q=is%3Aissue+is%3Aopen+label%3A%22import+source%22).
51+
# Usage
52+
53+
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.
54+
55+
## Command line usage
56+
57+
For offline use, or convenience in the terminal, you can also install speedscope
58+
via npm:
59+
60+
npm install -g speedscope
61+
62+
Invoking `speedscope /path/to/profile` will load speedscope in your default browser.
63+
64+
## Self-contained directory
65+
66+
If you don't have npm or node installed, you can also download a
67+
self-contained version from https://github.com/jlfwong/speedscope/releases.
68+
After you download the zip file from a release, simply unzip it and open the
69+
contained `index.html` in Chrome or Firefox.
70+
71+
## Importing via URL
72+
73+
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.
74+
75+
## Views
76+
77+
### 🕰Time Order
78+
![Detail View](https://user-images.githubusercontent.com/150329/42108613-e6ef6d3a-7b8f-11e8-93d4-541b2cb93fe5.png)
79+
80+
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".
81+
82+
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.
83+
84+
85+
### ⬅️Left Heavy
86+
![Left Heavy View](https://user-images.githubusercontent.com/150329/44534434-a05f8380-a6ac-11e8-86ac-e3e05e577c52.png)
87+
88+
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.
89+
90+
### 🥪 Sandwich
91+
![Sandwich View](https://user-images.githubusercontent.com/150329/42108467-76a57baa-7b8f-11e8-815f-1df7b6ac3ede.png)
92+
93+
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.
94+
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
95+
row.
96+
97+
98+
## Navigation
99+
100+
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".
101+
102+
### Minimap Navigation
103+
104+
* Scroll on either axis to pan around
105+
* Click and drag to narrow your view to a specific range
106+
107+
### Stack View Navigation
108+
109+
* Scroll on either axis to pan around
110+
* Pinch to zoom
111+
* Hold Cmd+Scroll to zoom
112+
* Double click on a frame to fit the viewport to it
113+
* Click on a frame to view summary statistics about it
114+
115+
### Keyboard Navigation
116+
117+
* `+`: zoom in
118+
* `-`: zoom out
119+
* `0`: zoom out to see the entire profile
120+
* `w`/`a`/`s`/`d` or arrow keys: pan around the profile
121+
* `1`: Switch to the "Time Order" view
122+
* `2`: Switch to the "Left Heavy" view
123+
* `3`: Switch to the "Sandwich" view
124+
* `r`: Collapse recursion in the flamegraphs
125+
* `Cmd+S`/`Ctrl+S` to save the current profile
126+
* `Cmd+O`/`Ctrl+O` to open a new profile
127+
* `n`: Go to next profile/thread if one is available
128+
* `p`: Go to previous profile/thread if one is available
129+
* `t`: Open the profile/thread selector if available
130+
* `Cmd+F`/`Ctrl+F`: to open search. While open, `Enter` and `Shift+Enter` cycle through results
131+
132+
## Contributing
133+
134+
Do you want to contribute to speedscope? Sweeeeet. Check out [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on setting up your dev environment.

0 commit comments

Comments
 (0)