Commit Graph

377 Commits

Author SHA1 Message Date
Jamie Wong
32c2d637db
Improve readability and correct bounds of selection & hover rectangles (#45)
Before:

![image](https://user-images.githubusercontent.com/150329/40530496-e7802094-5fad-11e8-8af1-de05775e529b.png)

After: 

![image](https://user-images.githubusercontent.com/150329/40530506-f142215e-5fad-11e8-97d7-f82ead458b23.png)
2018-05-24 23:56:23 -07:00
Jamie Wong
756a3ff5ac
Fixes for details view (#44)
This contains 2 fixes for the details view
The first is that the padding in the scrolling view was causing the last frame to be clipped
The second is that we were uselessly displaying "(speedscope root)" in the stack trace view.

This also removes some sketch specific stuff from the keyed archive expanding code

Fixes #32
2018-05-20 14:42:16 -07:00
Jamie Wong
9edd5ce7ed Add Synalize It! Pro grammars Instruments for safe keeping 2018-05-17 09:13:55 -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
Jamie Wong
2cc3f7f141 Set the CNAME record in the deploy 2018-05-09 00:00:28 -07:00
Jamie Wong
7d68c24737 Fix deploy script 2018-05-08 23:56:13 -07:00
Jamie Wong
ba7df9bef3
Change the public asset directory to be top level now that we have a domain (#36)
We previously had to serve from `/speedscope/` because the website was https://jlfwong.github.io/speedscope/. Now that we're going to serve from https://www.speedscope.app, we no longer have to do that (in fact it's important that we don't do that).
2018-05-08 23:53:06 -07:00
Jamie Wong
f9032f4100
Reorganize sample directory (#34)
This should help keep things organized as speedscope supports more languages & more formats

Test Plan: Try importing from every single file type, see that the link to load the example profile still works
2018-05-08 23:13:38 -07:00
Jamie Wong
2b9f7ffe1b
Support importing from instruments via deep copy (#33)
Instruments has a complex binary file format. If we're interested in just having a nice flamegraph display of the contents and don't care too much about time ordering or symbol file locations, then we can just grab the information we need from the clipboard rather than deal with the binary file format. This also avoids needing to deal with multiple processes or multiple threads.

This PR contains 2 compressed `.trace` files. In each, if you select the top row in the call tree view and hit "Cmd+Shift+C" or go to "Edit -> Deep Copy", then paste into speedscope, you should get the corresponding flamechart.

## Allocations Profile

![image](https://user-images.githubusercontent.com/150329/39796943-5d900c88-530e-11e8-8dea-fa0a44888a64.png)

![image](https://user-images.githubusercontent.com/150329/39796949-65f6a9f4-530e-11e8-8509-64816cebe74c.png)

## Time Profile

![image](https://user-images.githubusercontent.com/150329/39796956-6fd88776-530e-11e8-9978-14aba8e883e1.png)

![image](https://user-images.githubusercontent.com/150329/39796973-8983189e-530e-11e8-8d82-92183c8590f6.png)
2018-05-08 22:27:31 -07:00
Jamie Wong
84504f650a
Fix browser zoom issues by not caching devicePixelRatio (#27)
When devicePixelRatio changes, a window resize event will fired, which should fix both #25 and #9.

To test this, I focused the location bar and zoomed into the page.

Before this PR:

![image](https://user-images.githubusercontent.com/150329/38972079-630a0fa8-4353-11e8-8278-3e33fda5ae6e.png)

After this PR:

![image](https://user-images.githubusercontent.com/150329/38972082-6847a2d2-4353-11e8-8d5b-4a5bd1ed9d03.png)


Fixes #25 
Fixes #9
2018-04-18 22:18:37 -07:00
Jamie Wong
2bfb2ae1bd Fix typo in file name 2018-04-18 21:44:39 -07:00
Jamie Wong
e519785924 Update README with note about Firefox support 2018-04-17 18:52:43 -07:00
Jamie Wong
7ca4a41a6a
Support importing from Firefox (#26) 2018-04-17 18:50:53 -07:00
Jamie Wong
caba525465
Add a detail view to view aggregate statistics & file details (#23)
![image](https://user-images.githubusercontent.com/150329/38852391-9706fb4e-41ce-11e8-8296-a236928820c6.png)

This introduces a view for showing detailed information about a selected frame in the flamegraph. This provides information about self time & aggregate times across all instances of the function, regardless of where it is in the flamegraph.

This also shows a full stack with file & line information.

Fixes #20
2018-04-17 00:04:24 -07:00
Alan Pierce
7c1118a425 Add profileURL and title hash parameters (#19)
On init, we check the hash fragment for these parameters and load the URL. We
always show a loading state in that case rather than the landing screen.

When determining the title, an explicitly-specified title takes precedence,
otherwise we use the filename.

I also added an error state, currently only used for my new code, but possibly
there could be a more robust or widespread error handling approach in the
future.
2018-04-14 20:38:04 -07:00
Jamie Wong
702d8cf5b4
Merge pull request #17 from alangpierce/set-up-prettier
Set up Prettier and run it on the whole codebase
2018-04-14 16:56:31 -07:00
Alan Pierce
404aacfa46 Address review comments
* Switch to `bracketSpacing: false`.
* Add prettier-ignore in one case.
2018-04-14 16:19:26 -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
298056a9ef
Add MIT License 2018-04-08 22:35:53 -07:00
Jamie Wong
f4d14e55d0 Fix deploy 2018-04-05 00:59:56 -07:00
Jamie Wong
e630b21420 Rename release to deploy 2018-04-05 00:53:49 -07:00
Jamie Wong
971c0a2dc4 More tweaks to release process 2018-04-05 00:53:21 -07:00
Jamie Wong
045be2831b Prevent an infinite loop 2018-04-05 00:41:49 -07:00
Jamie Wong
e4a6d2e3f3 Include commit in gh-pages branch to see which version is deployed 2018-04-05 00:32:26 -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
aee0554635 release 2018-02-05 11:06:21 -08:00
Jamie Wong
bd40956722 Change triangle wave frequency for color generation 2018-02-05 11:04:42 -08:00
Jamie Wong
f86a4f0d00 More colorscheme tweaking 2018-02-05 11:02:30 -08:00
Jamie Wong
fac7356d21 Use triangle wave instead of fract for colorscheme 2018-02-02 09:04:29 -08:00
Jamie Wong
1525c3fa04 Switch to more canonical HCL, re-enable HMR 2018-02-01 23:14:47 -08:00
Jamie Wong
8e32110a0d Update README 2018-01-31 10:21:48 -08:00
Jamie Wong
3d2b94b3ba release 2018-01-31 10:16:21 -08:00
Justin Li
79e4ff0e50 Focus frames beneath a node on dblclick (#1) 2018-01-31 10:15:29 -08:00
Jamie Wong
d6652388c9 release 2018-01-30 12:29:49 -08:00
Jamie Wong
f25f8fc5cc Fix for Chrome timelines containing multiple CPU profiles 2018-01-30 12:29:25 -08:00
Jamie Wong
f9af0fddb2 release 2018-01-30 10:34:47 -08:00
Jamie Wong
583cc1ad7c Fix window resize behavior 2018-01-30 10:34:28 -08:00
Jamie Wong
1ba3e00bd2 release 2018-01-30 02:19:10 -08:00
Jamie Wong
15e5e73d30 Simplify code a bit with framebuffer.use 2018-01-30 02:07:05 -08:00
Jamie Wong
53656fef43 I think it works!!!!! 2018-01-30 01:51:02 -08:00
Jamie Wong
838cc06ff5 Outline rendering WIP 2018-01-29 11:53:39 -08:00
Jamie Wong
45dd408163 Line-tiled cache seems like it works!!!! 2018-01-28 13:35:21 -08:00
Jamie Wong
31829c4aa0 Row atlas seems like it is working! 2018-01-28 12:29:41 -08:00
Jamie Wong
4fcd40da98 Row atlas sort of working? 2018-01-28 03:13:12 -08:00
Jamie Wong
5412573ba3 Make NDC an implementation detail 2018-01-27 21:21:38 -08:00
Jamie Wong
37e2b78ad8 Rendering from one big texture working, make using texture rendering more ergonomic 2018-01-27 20:19:45 -08:00
Jamie Wong
ba8241b0d3 Add modified version of stats.js 2018-01-27 18:29:27 -08:00
Jamie Wong
82ad36f55a Texture based approach WIP 2018-01-25 21:15:35 -08:00
Jamie Wong
f103f3ad7a Fix minimap rendering bug when switching between views 2018-01-25 12:04:30 -08:00