Commit Graph

56 Commits

Author SHA1 Message Date
Jamie Wong
c706bdfe04 Revert "Support importing partial JSON files (#202)"
This reverts commit cfc8fe8f6e.
2019-02-08 18:33:30 -08:00
Marcin Kolny
cfc8fe8f6e Support importing partial JSON files (#202)
Partial files are allowed in many specs, e.g. Trace Event Format,
so the viewer should be able to load partial files as well.
2019-02-08 18:08:51 -08:00
Jamie Wong
ddc61302e8 1.4.1 2019-01-22 21:53:09 -08:00
Jamie Wong
7cca1a76bc 1.4.0 2019-01-22 12:03:31 -08:00
Jamie Wong
519847b489 1.3.2 2018-12-03 19:25:54 -08:00
Jamie Wong
ad49dacb29 1.3.1 2018-11-08 10:05:52 -08:00
Jamie Wong
23d4042e04 1.3.0 2018-10-29 09:56:06 -07:00
Jamie Wong
0fe0c454d3 1.2.0 2018-10-08 09:49:15 -07:00
Jamie Wong
7d0a3a2c59 1.1.0 2018-09-26 11:46:41 -07:00
Jamie Wong
3f205ec3e9
Add go tool pprof import support (#165)
This PR adds support for importing from Google's pprof format, which is a gzipped, protobuf encoded file format (that's incredibly well documented!) The [pprof http library](https://golang.org/pkg/net/http/pprof/) also offers an output of the trace file format, which continues to not be supported in speedscope to date (See #77). This will allow importing of profiles generated by the standard library go profiler for analysis of profiles containing heap allocation information, CPU profile information, and a few other things like coroutine creation information.

In order to add support for that a number of dependent bits of functionality were added, which should each provide an easier path for future binary input sources

- A protobuf decoding library was included ([protobufjs](https://www.npmjs.com/package/protobufjs)) which includes both a protobuf parser generator based on a .proto file & TypeScript definition generation from the resulting generated JavaScript file
- More generic binary file import. Before this PR, all supported sources were plaintext, with the exception of Instruments 10 support, which takes a totally different codepath. Now binary file import should work when files are dropped, opened via file browsing, or opened via invocation of the speedscope CLI.
- Transparent gzip decoding of imported files (this means that if you were to gzip compress another JSON file, then importing it should still work fine)

Fixes #60.

--

This is a [donation motivated](https://github.com/jlfwong/speedscope/issues/60#issuecomment-419660710) PR motivated by donations by @davecheney & @jmoiron to [/dev/color](https://www.devcolor.org/welcome) 🎉
2018-09-26 11:33:34 -07:00
Jamie Wong
c70171836c 1.0.4 2018-09-12 18:22:59 -07:00
Jamie Wong
c9ba143eb6 1.0.3 2018-09-10 13:54:32 -07:00
Jamie Wong
2686a3ccc0 1.0.2 2018-09-04 20:55:25 -07:00
Jamie Wong
82867ab234 1.0.1 2018-08-23 10:01:13 -07:00
Jamie Wong
da2de64d97 1.0.0 2018-08-23 09:38:56 -07:00
Jamie Wong
03578ea7a4 0.7.1 2018-08-20 08:46:13 -07:00
Jamie Wong
2c89cefcdc
Replace regl with GPU apis ported from evanw/sky (#140)
Fixes #101 
Fixes #137
2018-08-19 11:37:47 -07:00
Jamie Wong
853164ebbf 0.7.0 2018-08-16 11:56:17 -07:00
Jamie Wong
729d7c771b
Add support for importing linux "perf script" output (#135)
Fixes #119
2018-08-16 10:24:12 -07:00
Jamie Wong
085d6298ec 0.6.0 2018-08-14 10:34:34 -07:00
Jamie Wong
aa35b17d20
Downgrade to TypeScript 2.8.1 to fix JSON schema generation (#133)
Fixes #132
2018-08-14 09:37:42 -07:00
Jamie Wong
e404053837 Add support for profiles w/ multiples processes & threads (#130)
More broadly, this just supports multiple profiles loaded into the editor in the same time, which supports import from profiles which are multithreaded by importing each thread as a different profile.

For now, the only two file formats that support multiprocess import are Instruments .trace files and speedscope's own file format

In the process of doing this, I refactored the container code considerably and extracted all the dispatch calls into containers rather than them being part of the non-container view code. This is nice because it means that views don't have to be aware of which Flamechart they are or which profile index is being operated upon.

Fixes #66
Fixes #82
Fixes #91
2018-08-11 22:06:53 -07:00
Jamie Wong
558e98d24d 0.5.1 2018-08-11 22:05:39 -07:00
Jamie Wong
7368e15396 0.5.0 2018-08-09 09:38:55 -07:00
Jamie Wong
94d0879417
Upgrade to TypeScript 3.0.1 (#110)
Fixes #103
2018-08-01 01:23:21 -07:00
Jamie Wong
608006232f
Reorganize directory structure (#104)
While it was kind of nice having everything at the top level, the number of files is now getting a bit unwieldy and hard to understand, so I took a stab at organizing the directories without introducing too much nesting.

Test Plan:
- Ran `npm run serve` to ensure that local builds still work
- Ran `npm run prepack` then `open dist/release/index.html` to ensure that release builds still work
- Ran `scripts/deploy.sh` to ensure that the deployed version of the site will still work when I eventually redeploy
- Ran `npm run jest` to ensure that tests still work correctly
2018-08-01 00:41:45 -07:00
Jamie Wong
11a3a67dce
Switch to redux for global state management (#100)
This should allow state to be more easily retained globally when switching views, and should make implementation of cross-view features like search easier too.

It also removes the need for `ReloadableComponent`

Fixes #78

Test Plan:
This changes a lot of how the app works, and a lot of stuff that isn't currently covered by tests, so here's a rough manual test plan:

1. Loaded up http://localhost:1234/, click to load the example profile
2. Switch between views, see that viewport & selection position is now retained when switching views
3. See that clicking on nodes selects them in Time Order & Left Heavy views
4. See that hitting Cmd+S saves a profile
5. See that dropping a profile in works
6. See that dropping a profile + a symbol map works
7. See that visiting localhost:1234/#profileURL=https://raw.githubusercontent.com/jlfwong/speedscope/master/sample/profiles/speedscope/0.1.2/simple-sampled.speedscope.json works
8. See that hitting "r" to toggle recursion flattening works
2018-07-31 23:53:56 -07:00
Jamie Wong
2f95f77fcf 0.4.0 2018-07-21 19:44:57 -07:00
Jamie Wong
ea8f982c10
Import from node profiles via v8 logs (#98)
This is inspired by https://github.com/mapbox/flamebearer
2018-07-21 16:00:25 -07:00
Jamie Wong
d7969ac2b8 0.3.0 2018-07-18 08:54:53 -07:00
Jamie Wong
8fcc0f8108 0.2.0 2018-07-14 00:35:58 -07:00
Jamie Wong
6aa66bead2 Start with loading bar enabled when loading a local profile 2018-07-07 23:12:03 -07:00
Jamie Wong
bcecf9c260 Set name to filename by default 2018-07-07 23:05:49 -07:00
Jamie Wong
3172e61f05
Add a CLI to load the target file in your default browser (#88)
This PR add a CLI speedscope which load file given as an argument in your default browser. Expected usage looks like:

```
speedscope /path/to/profile
```

Note that since we're using base64 encoded strings as a transport for this, this won't work with multi-file profiles, like the Instruments .trace files. This could be augmented to support that by archiving the contents, but that can be handled in a different PR.

This PR also set up a viable model for integrating speedscope into other projects. By replicating the contents of `cli.js` in other languages, integration should be possible in other languages with no dependency upon node in any way. Distribution should consist of just HTML, JS, and CSS assets to be loaded in browser.

Test Plan:
- Ran the following to simulate a publish & subsequent installation:

```
$ npm pack
$ mv speedscope-0.1.0.tgz /tmp/
$ cd /tmp
$ tar -xvvf speedscope-0.1.0.tgz
$ cd package
$ npm install --only=production
$ ./cli.js
Opening file:///private/tmp/package/dist/release/index.html in your default browser
$ ./cli.js ~/code/speedscope/sample/profiles/Chrome/65/timeline.json
Creating temp file /var/folders/l0/qtd9z14973s2tw81vmzwkyp00000gp/T/speedscope-1531023992823-3880.js
Creating temp file /var/folders/l0/qtd9z14973s2tw81vmzwkyp00000gp/T/speedscope-1531023992823-3880.html
Opening file:///var/folders/l0/qtd9z14973s2tw81vmzwkyp00000gp/T/speedscope-1531023992823-3880.html in your default browser
```

Fixes #24
2018-07-07 21:33:02 -07:00
Jamie Wong
e39381e498
Specify file format for speedscope (#83)
This defines a JSON-based file format for speedscope.

The motivation for is primarily two things:
1. To enable others to write tools to output profiles which can be read by speedscope
2. To enable others to write tools to handle the output of speedscope, leveraging the variety of importers that speedscope supports

Fixes #65
2018-07-07 18:37:28 -07:00
Jamie Wong
94f0875dc0 Upgrade parcel-bundler to 1.9.2 2018-06-30 15:44:46 -07:00
Jamie Wong
721246752f Setup for publish 2018-05-31 00:24:24 -07:00
Jamie Wong
2207ff54ce
Add tests for importers (#56)
This also fixes deep copy import for Instruments when copying from Instruments 7

Related to #14
2018-05-29 23:53:03 -07:00
Jamie Wong
d23660d13c
Add test coverage reporting (#55)
This adds an integration with https://coveralls.io/ to report on code coverage of tests
2018-05-29 19:59:04 -07:00
Jamie Wong
3aa0944f94
Add tests for Vec2, Rect, and AffineTransform (#52)
* Tests for clamp, Vec2

* Switch to using jsverify for testing math functions

* Add tests for AffineTransform

* Add tests for Rect

* Add tests for rect transformations
2018-05-29 17:05:04 -07:00
Jamie Wong
aee4534de4
Integrate jest and add first test file (#51)
This sets up the first bit of test infrastructure to write and run unit tests on every PR

Related to #14 
Fixes #7
2018-05-29 14:34:09 -07:00
Jamie Wong
274110a46b
Support importing time profiles from Instruments .trace files (#41)
#33 added support for importing from instruments indirectly via opening instruments and using the deep copy command. This PR adds support for importing `.trace` files directly, though only for time profiles specifically, and only for the highest sample count thread in the profile.

This PR adds `.trace` files from Instruments 9, and adds support for importing from either Instruments 8 and 9. The only major difference in the file format seems to be that Instruments 9 applies raw `zlib` compression generously throughout the file.

This PR also adds example `.trace` files for memory allocations, which are not supported for direct import. They use a totally different storage format for recording memory allocations, and I haven't yet figured out how that list of allocations references their corresponding callstack.

Lastly, this PR also adds examples from Instruments 7 since I happen to have a machine with an old version of Instruments. Import from Instruments 7 probably wouldn't be hard to add, but I haven't done that in this PR.

This currently only works in Chrome, and only via drag-and-drop of the files.

To test, drag the decompressed `simple-time-profile.trace` from 6016d970b9/sample/profiles/Instruments/9.3.1/simple-time-profile.trace.zip onto speedscope.

The result should be this:

![image](https://user-images.githubusercontent.com/150329/40162338-8fa13502-5968-11e8-8fb3-40626e41884a.png)

Fixes #15
2018-05-17 00:33:09 -07:00
Alan Pierce
1bcb88670b Set up Prettier and run it on the whole codebase
* Install prettier, set up the config file, and run it on all ts and tsx files.
* Install eslint and configure it with just eslint-plugin-prettier to check to
  make sure that prettier has been run.
* Add a basic .travis.yml that runs eslint.

There are other style things that might be nice to enforce with ESLint/TSLint,
like using const, import order, etc, but this commit just focuses on prettier,
which gets most of the way there.

One annoying issue for now is that typescript-eslint-parser gives a big warning
message since they haven't updated to officially support TypeScript 2.8 yet. We
aren't even using any ESLint rules that need the parser, but if we don't include
it, ESLint will crash. TS2.8 support is hopefully coming really soon, though:
https://github.com/eslint/typescript-eslint-parser/pull/454

As for the prettier config specifically, see https://prettier.io/docs/en/options.html
for the available options.

Config settings that seem non-controversial:

Semicolons: You don't use semicolons. (I prefer semicolons, but either way is fine.)

Quote style: Looks like you consistently use single quotes outside JSX and double
quotes in JSX, which is the `singleQuote: true` option.

Config settings worth discussion:

Line width: You don't have a specific max. I put 100 since I think it's a good number
for people (like both of us, probably) who find 80 a bit cramped. (At Benchling we use
110.) Prettier has a big red warning box recommending 80, but I still prefer 100ish.

Bracket spacing: This is `{foo}` vs `{ foo }` for imports, exports, object literals,
and destructuring. Looks like you're inconsistent but lean toward spaces. I personally
really dislike bracket spacing (it feels inconsistent with arrays and function calls),
but I'm certainly fine with it and Prettier has it enabled by default, so I kept it
enabled.

Trailing comma style: Options are "no trailing commas", "trailing commas for
everything exception function calls and parameter lists", and "trailing commas
everywhere". TypeScript can handle trailing commas everywhere, so there isn't a
concern with tooling. You're inconsistent, and it looks like you tend to not have
trailing commas, but I think it's probably best to just have them everywhere, so I
enabled them.

JSX Brackets: You're inconsistent about this, I think. I'd prefer to just keep the
default and wrap the `>` to the next line.

Arrow function parens: I only found two cases of arrow functions with one param
(both `c => c.frame === frame`), and both omitted the parens, so I kept the
default of omitting parens. This makes it mildly more annoying to add a typescript
type or additional param, which is a possible reason for always requiring parens.

Everything else is non-configurable, although it's possible some places would be
better with a `// prettier-ignore` comment (but I usually try to avoid those).
2018-04-14 08:40:06 -07:00
Jamie Wong
e630b21420 Rename release to deploy 2018-04-05 00:53:49 -07:00
Jamie Wong
5104e5cdcb
Demangle C++ symbols (#2)
This adds support for demangling C++ symbols automatically (they'll have a name prefix of `__Z`).
2018-04-05 00:27:03 -07:00
Jamie Wong
1987e83bde
Upgrade libraries & change release procedure (#8)
Previously, I was doing a hacky release process where I had `index.html` serve contents for `jlfwong.github.io/speedscope`, but used `dev.html` locally. This seems like it broke with the latest parcel release, so I just revamped the release process instead.

Now, the `release.sh` script creates a temporary shallow clone of the repository, overwrites its contents with build artifacts, runs a local server to verify it's working, then commits and pushes to the `gh-pages` branches.
2018-04-05 00:15:42 -07:00
Jamie Wong
1525c3fa04 Switch to more canonical HCL, re-enable HMR 2018-02-01 23:14:47 -08:00
Jamie Wong
4fcd40da98 Row atlas sort of working? 2018-01-28 03:13:12 -08:00
Jamie Wong
8ba298b216 Basic landing page 2018-01-07 11:45:05 -08:00
Jamie Wong
a51382c525 Hot reloading WIP 2017-12-23 13:37:56 -05:00