From 1dfe2f4471da297c774ed0144f162e8dba94e0e0 Mon Sep 17 00:00:00 2001 From: Cong-Cong Date: Thu, 25 Jan 2024 14:47:16 +0800 Subject: [PATCH 1/3] feat: improve profiling section --- src/profiling/intro.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/profiling/intro.md b/src/profiling/intro.md index fe705bb..db814bb 100644 --- a/src/profiling/intro.md +++ b/src/profiling/intro.md @@ -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. @@ -80,7 +81,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 root `Cargo.toml`, turn on debug symbols and disable symbol stripping in the `[profile.release]` section ```toml [profile.release] From 0eb1ac6ab23c69acd8304d5a137fae9b838852c8 Mon Sep 17 00:00:00 2001 From: Cong-Cong Pan Date: Thu, 25 Jan 2024 16:36:10 +0800 Subject: [PATCH 2/3] feat: add screenshots related to the tracing tool --- src/profiling/intro.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/profiling/intro.md b/src/profiling/intro.md index db814bb..aec84c7 100644 --- a/src/profiling/intro.md +++ b/src/profiling/intro.md @@ -24,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 @@ -69,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 From 694462fc456329af84db2afcfcd5d2f764e01e17 Mon Sep 17 00:00:00 2001 From: Cong-Cong Date: Thu, 25 Jan 2024 16:38:24 +0800 Subject: [PATCH 3/3] fix: duplicate word --- src/profiling/intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/profiling/intro.md b/src/profiling/intro.md index aec84c7..eec3ff0 100644 --- a/src/profiling/intro.md +++ b/src/profiling/intro.md @@ -85,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 workspace root's root `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]