diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2021-04-19 03:17:32 +0000 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2021-04-19 03:17:32 +0000 |
commit | 194577be990dabc539c54e743fdc37bfb359ea63 (patch) | |
tree | 11f0cc2296ee0e566fff04618c056f82da16a6f2 | |
parent | 7b9b268b318009129b2ae52b9544ce77507f1ae7 (diff) | |
parent | 8debaa265074c30183a080a2cc63745e12a3b758 (diff) | |
download | gjs-194577be990dabc539c54e743fdc37bfb359ea63.tar.gz |
Merge branch 'doc-profiling' into 'master'
doc: Add simple sysprof example
See merge request GNOME/gjs!606
-rw-r--r-- | doc/Profiling.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/Profiling.md b/doc/Profiling.md new file mode 100644 index 00000000..e84d3af2 --- /dev/null +++ b/doc/Profiling.md @@ -0,0 +1,28 @@ +# Profiling GJS + +## Profiling with Sysprof + +Typical profiling of JavaScript code is performed by passing the `--gjs` and +`--no-perf` options: + +```sh +$ sysprof-cli --gjs --no-perf -- gjs script.js +``` + +This will result in a `capture.syscap` file in the current directory, which can +then be reviewed in the sysprof GUI: + +```sh +$ sysprof capture.syscap +``` + +Other flags can also be combined with `--gjs` when appropriate: + +```sh +sysprof-cli --gjs --gtk -- gjs gtk.js +``` + +### Additional Reading + +* Christian Hergert's [Blog Posts on Sysprof](https://blogs.gnome.org/chergert/category/sysprof/) + |