diff --git a/README.md b/README.md index a738ef103fc..45ce102a6d3 100644 --- a/README.md +++ b/README.md @@ -67,16 +67,42 @@ installing all required tools without nix is out of scope). ## Create a coverage report -Run +Three ways of obtaining the coverage report: - BISECT_COVERAGE=YES make -C src asc - make -C test coverage - -and open `test/coverage/index.html` in the browser, or run + * Run + ``` + BISECT_COVERAGE=YES make -C src asc + make -C test coverage + ``` + and open `test/coverage/index.html` in the browser. + * Alternatively, you can run + ``` nix-build -A coverage-report + ``` + and open the path printed on the last line of that command. + * On the VPN, simply go to + + for the report for the latest version on `master`. + +## Profile the compiler -and open the path printed on the last line of that command. +1. Build with profiling + ``` + make -C src clean + make BUILD=p.native -C src asc + ``` +2. Run `asc` as normal, e.g. + ``` + ./src/asc --dfinity -c foo.as -o foo.wasm + ``` + this should dump a `gmon.out` file in the current directory. +3. Create the report, e.g. using + ``` + gprof --graph src/asc + ``` + (Note that you have to _run_ this in the directory with `gmon.out`, but + _pass_ it the path to the binary.) ## Introduction