diff --git a/.gitignore b/.gitignore index 9f85a70ad04..972d1eb0f84 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ tests/js/test.js *.string_data *.string_index *.events -chrome_profiler.json \ No newline at end of file +chrome_profiler.json diff --git a/README.md b/README.md index a186397834e..cccbcbfd580 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,6 @@ $ yarn serve In the console you can use `window.evaluate` to pass JavaScript in To develop on the web assembly side you can run `yarn serve` then go to `http://localhost:8080` -## Roadmap - -See Milestones - ## Changelog see [CHANGELOG](./CHANGELOG.md) @@ -66,6 +62,10 @@ see [CHANGELOG](./CHANGELOG.md) - Run with `cargo run -- test.js` where `test.js` is an existing JS file - If any JS doesn't work then it's a bug. Please raise an issue! +## Profiling + +See [Profiling](./docs/profiling.md) + ## Command-line Options ``` diff --git a/docs/profiling.md b/docs/profiling.md index ff9234f22c6..fee3c135fae 100644 --- a/docs/profiling.md +++ b/docs/profiling.md @@ -9,10 +9,19 @@ We use a crate called [measureme](https://github.com/rust-lang/measureme), which ## How To Use +### Prerequesites + +- [Crox](https://github.com/rust-lang/measureme/blob/master/crox/Readme.md) installed + You can run boa using the "profiler" feature flag to enable profiling. Seeing as you'll most likely be using boa_cli you can pass this through, like so: `cargo run --features Boa/profiler ../tests/js/test.js` +Once finished you should see some trace files left in the directory (boa_cli in this case). +In the same directory as the `.events, string_data, string_index` files run `crox my_trace` or whatever the name of the files are. This will generate a chrome_profiler.json file, you can load this into Chrome Dev tools. + ## More Info -https://blog.rust-lang.org/inside-rust/2020/02/25/intro-rustc-self-profile.html +- https://blog.rust-lang.org/inside-rust/2020/02/25/intro-rustc-self-profile.html +- https://github.com/rust-lang/measureme +- https://github.com/rust-lang/measureme/blob/master/crox/Readme.md