Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
feat: improve profiling section (#31)
Browse files Browse the repository at this point in the history
* feat: improve profiling section

* feat: add screenshots related to the tracing tool

* fix: duplicate word
  • Loading branch information
SyMind authored Jan 25, 2024
1 parent ce0450c commit ce0b3a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/profiling/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

In this section, we'll explore how to profile Rspack for identifying bottlenecks.
By examining where Rspack spends its time, we can gain insights into how to improve performance.
Since different profilers have different strengths. It is good to use more than one.

<!-- toc -->

Expand All @@ -23,6 +24,8 @@ Two ways to enable tracing:

[`tracing-chrome`](https://crates.io/crates/tracing-chrome) is supported for viewing tracing information graphically.

![image](https://github.com/SyMind/rspack-dev-guide/assets/19852293/1af08ba1-a2e9-4e3e-99ab-87c1e62e067b)

Setting the environment variable `RSPACK_PROFILE=TRACE=layer=chrome` before running Rspack, for example

```bash
Expand Down Expand Up @@ -68,6 +71,8 @@ speedscope CPU.20230522.154658.14577.0.001.cpuprofile

Xcode instruments can be used to produce a CPU profile if you are on a Mac.

![image](https://github.com/SyMind/rspack-dev-guide/assets/19852293/124e3aee-944a-4509-bb93-1c9213f026d3)

To install Xcode Instruments, simply install the Command Line Tools:

```bash
Expand All @@ -80,7 +85,7 @@ for profiling and creating the trace file.
Since Rspack takes quite a while to build, you can use the following procedure without invoking `cargo instruments`.
It has the same effect.

In `crates/node_binding/Cargo.toml`, turn on debug symbols and disable symbol stripping in the `[profile.release]` section
In workspace root's `Cargo.toml`, turn on debug symbols and disable symbol stripping in the `[profile.release]` section

```toml
[profile.release]
Expand Down

0 comments on commit ce0b3a6

Please sign in to comment.