[gjs: 1/2] doc: Add simple sysprof example




commit 8debaa265074c30183a080a2cc63745e12a3b758
Author: Andy Holmes <andrew g r holmes gmail com>
Date:   Sun Apr 18 17:51:11 2021 -0700

    doc: Add simple sysprof example
    
    Add a doc on profiling GJS code with a simple example of using sysprof

 doc/Profiling.md | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
---
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/)
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]