@@ -156,6 +156,39 @@ If you've collected new data, you can run `curl -X POST
156
156
localhost:2346/perf/onpush` to update the site's view of the data, or just
157
157
restart the server.
158
158
159
+ ### Benchmarking on Windows
160
+
161
+ To benchmark on Windows, you will need to run the collector in a elevated context
162
+ so that it can access the hardware performance counters. Note: some virtualized
163
+ environments do not permit access to these counters for guest VMs.
164
+
165
+ You will also need to provide the paths to the xperf and tracelog tools (or have them
166
+ available on your PATH). Some common paths to these tools look like:
167
+
168
+ ``` pwsh
169
+ $env:XPERF="C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\xperf.exe"
170
+ $env:TRACELOG="C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\tracelog.exe"
171
+ ```
172
+
173
+ Finally, while most of the options you can pass to the collector are supported, the majority of
174
+ the profilers used in the ` profile_local ` command are not. In Windows, the only currently supported
175
+ profiler is the ` self-profiler ` .
176
+
177
+ As a complete example, let's run just the ` regex ` benchmark in the ` Debug ` build with
178
+ self-profiling results available:
179
+
180
+ ``` pwsh
181
+ $env:XPERF="C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\xperf.exe"
182
+ $env:TRACELOG="C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\tracelog.exe"
183
+ .\target\release\collector.exe bench_local $env:RUST_ORIGINAL Original --builds Debug --include regex --self-profile
184
+ .\target\release\collector.exe bench_local $env:RUST_MODIFIED Modified --builds Debug --include regex --self-profile
185
+ .\target\release\site.exe .\results.db
186
+ ```
187
+
188
+ The open a web browser to ` http://localhost:2346/compare.html?start=Original&end=Modified&stat=instructions%3Au ` .
189
+
190
+ Note: This example uses Powershell syntax.
191
+
159
192
### Technical details of the benchmark server
160
193
161
194
We download the artifacts (rustc, rust-std, cargo) produced by CI and properly
0 commit comments