Commit Graph

293 Commits

Author SHA1 Message Date
Jamie Wong
6562fec7a7
Use TextDecoder if available for converting from an ArrayBuffer for speed (#188)
#165 introduced a performance regression by using a really inefficient method for converting from array buffers into string. This should ix it by using `TextDecoder` instead.
2018-11-08 10:01:05 -08:00
Jamie Wong
23d4042e04 1.3.0 2018-10-29 09:56:06 -07:00
Vincent Rischmann
9961ed8295 Make the wasd keymappings work on azerty keyboards (#184)
Instead of using `key`, use `code` which according to [this](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code) should work consistently for different layouts.

I tested the modification on a french AZERTY keyboard and it works fine.
2018-10-29 09:43:10 -07:00
Tristan Hume
e35335fe3c Haskell GHC JSON format support (fixes #182) (#183)
Fixes #182 by adding support for importing the JSON profiling format created by GHC's built in profiling support when the executable is passed the `-pj` option. Produces a profile group containing both a time and allocation profile.

Unfortunately, GHC doesn't provide the raw sample information to get the time view to be useful, so only left heavy and sandwich are useful.

Includes a test profile, and I've also tested it on a more real large 2MB profile file in the UI and it works great.

I also modified the Readme to link to a wiki page I'm unable to create, but that should have something like this content copy-pasted into it:

# Importing from Haskell

GHC provides built in profiling support that can export a JSON file.
In order to do this you need to compile your executable with profiling
support and then pass the `-pj` RTS flag to the executable.

This will produce a `my-binary.prof` file in the current directory which
you can import into speedscope.

## Using GHC

See the [GHC manual page on profiling](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html)
for more extensive information on the command line flags available.

```
$ ghc -prof -fprof-auto -rtsopts Main.hs
$ ./Main +RTS -pj -RTS
```

## Using Stack

### With executables

```
$ stack build --profile
$ stack exec -- my-executable +RTS -pj -RTS
```

### With tests

```
stack test --profile --test-arguments "+RTS -pj -RTS"
```
2018-10-29 09:37:11 -07:00
Florian Hermouet-Joscht
86f4ba636d Use arrayBuffer instead of text for profileURL (#179)
When using #profileURL, some binary characters cannot be read if we use `fetch text`. So I changed that to use `arrayBuffer`.

Now we can read pprof protobuf files and normal JSON files instead of only text files.
2018-10-12 17:22:45 -07:00
Jamie Wong
0fe0c454d3 1.2.0 2018-10-08 09:49:15 -07:00
vmarchaud
4b292b2acf Add import of v8 heap allocation profile (#170)
This adds support for importing heap profiles from Chrome: https://developers.google.com/web/tools/chrome-devtools/memory-problems/#allocation-profile
2018-10-08 09:15:39 -07:00
Jamie Wong
d78d20e005
Update README.md 2018-09-26 13:38:36 -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
ee0c2c5025
Fix import from Chrome < 69 when there are multiple profiles
It seems like #160 accidentally broken import of profiles in some circumstances from Chrome < 69. Before #160, we always took the first profile in the list *but* the profiles were not sorted chronologically. After #160 but before this PR, we were taking the chronologically first.

After this PR, we always take the chronologically last `CpuProfile` event in the trace.
2018-09-12 18:21:04 -07:00
Jamie Wong
3ba60a424d
Update CHANGELOG.md 2018-09-10 14:40:18 -07:00
Jamie Wong
c9ba143eb6 1.0.3 2018-09-10 13:54:32 -07:00
Jamie Wong
802fc2d358 Add test for Chrome 69 import 2018-09-09 18:03:49 -07:00
Jamie Wong
b910a2069b
Fix import for Chrome 69, support leading idle time before first call (#160)
This PR fixes #159, and also fixes various small things about how profiles were imported for previous versions of Chrome & for Firefox.

The Chrome 69 format splits profiles across several [Trace Event Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview) events. There are two relevant events: "Profile" and "ProfileChunk". At first read through a profile, it seems like profiles are incorrectly terminated, but it seems like the cause of that is that, for whatever reason, events in the event log are not always sorted in chronological order. If sorted chronologically, then the event sequence can be parsed sensibly.

In the process of looking at this information, I also discovered that speedscope's chrome importer was incorrectly interpreting the value of the first element in `timeDeltas` array. It's intended to be the elapsed time since the start of the profile, not the time between the first pair of samples. This changes the weight attributed to the first sample.
2018-09-09 18:00:30 -07:00
William Martin Stewart
a1f9755f9c Pretty print JSON (#158) 2018-09-05 09:21:26 -07:00
Jamie Wong
2686a3ccc0 1.0.2 2018-09-04 20:55:25 -07:00
Jamie Wong
789f296c9c Run unit tests as part of release build 2018-09-04 20:53:58 -07:00
Jamie Wong
64e290c9fc Change deploy script to use assets from npm 2018-09-04 20:50:30 -07:00
Jamie Wong
a0eba8d434
Update CHANGELOG.md 2018-09-04 20:13:29 -07:00
januszn
281d9f9033 Allow optional CR before LF when probing collapsed stacks files (#154)
This fixes #152, in that it allows "collapsed stacks" files generated with
tools using Windows line endings to be imported into the tool verbatim.
2018-09-04 20:12:27 -07:00
Jamie Wong
44a1f520fe
Update CHANGELOG.md 2018-09-04 17:04:35 -07:00
Jonathan Chan
b6190362b4 Match more Firefox-internal locations (#156)
Looks like Firefox also generates locations with names like
`bound (self-hosted:951:0)`. We check for `self-hosted`, but not for
`self-hosted` with stuff after it following a colon. We should ignore
these too, otherwise we can end up with stuff on our stack that we don't
expect. This was causing Firefox profiles not to load because we
completed building the profile with a non-empty stack.

Attached is a profile that errors without this patch and successfully renders
with this patch.

[copy.json.zip](https://github.com/jlfwong/speedscope/files/2350583/copy.json.zip)
2018-09-04 17:03:55 -07:00
Jamie Wong
a09f27d816
Update CHANGELOG.md 2018-09-04 16:14:41 -07:00
Alex Dukhno
944a6cb126 Change time formatting for minutes from 1.50min to 1:30 (#153) 2018-09-04 13:30:02 -07:00
Jamie Wong
828beb7ccf
Update README-ADMINS.md 2018-08-23 10:04:42 -07:00
Jamie Wong
82867ab234 1.0.1 2018-08-23 10:01:13 -07:00
Jamie Wong
6116371ffb
Fix flamechart bleeding (#151)
Fixes #150
2018-08-23 09:59:16 -07:00
Jamie Wong
da2de64d97 1.0.0 2018-08-23 09:38:56 -07:00
Jamie Wong
9c6f88a9f2
Update README.md 2018-08-23 09:22:24 -07:00
Jamie Wong
48ae79a6a7 Revert "Update hero GIF in README"
This reverts commit 11585fed92.
2018-08-23 08:44:12 -07:00
Jamie Wong
11585fed92
Update hero GIF in README 2018-08-23 08:42:36 -07:00
Jamie Wong
f7279e088e
Update README.md 2018-08-23 08:15:59 -07:00
Jamie Wong
3fc631cf79
Fix a regression in resize behavior from #147 (#149)
The problem was that I was using `canvas.getBoundingClientRect()` to get the size to resize to, but that was changing as the result of CSS properties set on the canvas! Instead, we take the measurements of its container now which is set to fill the screen, and the canvas has its size entirely managed by `graphics.ts`.
2018-08-23 08:09:22 -07:00
Jamie Wong
5ab320b4cf
Update README.md 2018-08-23 08:07:03 -07:00
Jamie Wong
f60ab630be
Fix rendering bugs when device pixel ratio changes (#147)
Fixes #102
2018-08-22 20:36:09 -07:00
Jamie Wong
453f793042 Update instructions to push tags with release 2018-08-22 18:50:25 -07:00
Jamie Wong
a5c3184880 Add a way of generating a self-contained zip-file 2018-08-22 18:50:25 -07:00
Jamie Wong
3193b34c46
Update README.md 2018-08-21 10:20:08 -07:00
Jamie Wong
2df69b6713
Update README.md 2018-08-21 09:55:27 -07:00
Jamie Wong
777e605c7b
Update README.md to link to wiki pages for import instructions
Fixes #115
2018-08-21 09:55:06 -07:00
Jamie Wong
100578c536
Add contributor guidelines & documentation (#144)
Fixes #4
2018-08-20 09:42:44 -07:00
Jamie Wong
03578ea7a4 0.7.1 2018-08-20 08:46:13 -07:00
Jamie Wong
3210f8fc08
Fix text culling of ellipses along the left side of the viewport (#143)
Before:
![image](https://user-images.githubusercontent.com/150329/44312631-2c716280-a3b0-11e8-8834-2574b3a4a627.png)

After:
![image](https://user-images.githubusercontent.com/150329/44312639-48750400-a3b0-11e8-8017-41640fe56a22.png)

Fixes #134
2018-08-19 13:12:28 -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
9d13d95f8d Add a section about verifying the publish 2018-08-14 10:38:42 -07:00
Jamie Wong
085d6298ec 0.6.0 2018-08-14 10:34:34 -07:00