This repository contains a suite of scripts for benchmarking Interface. Scenes used by the benchmarks are available is the assets folde.
To use the benchmarking functionality, navigate to the hifi_tests/benchmarks directory, select the desired benchmark script, and run Interface from the command line as follows:
"%INTERFACE_EXE_PATH%" --testScript "%BENCHMARK_SCRIPT%"
Where %INTERFACE_EXE_PATH% is the path to the interface.exe you want to test, and %BENCHMARK_SCRIPT% is the benchmark you want to run. For example, to run the manual benchmark, which will add a "toggleTrace" button to your toolbar/tablet, one might type:
"C:\Program Files\High Fidelity\interface.exe" --testScript manual.js
Similarly, you can benchmark PRs:
"C:\Program Files\High Fidelity - PR12345\interface.exe" --testScript manual.js
This will create a zipped trace file, likely in your Documents/traces folder.
To view a trace, open Chrome and navigate to "chrome://tracing". Drag and drop the trace file from your files to this tab. After a few seconds Chrome will display all the activity on every thread captured during the trace.
For traces to be useful, you may want to define your own profile ranges. To do so in a script, use Script.beginProfileRange("name of your range")
and Script.endProfileRange("name of your range")
. For example, here is a version of handControllerGrab.js that uses a few profile ranges.
You can also create profile ranges on the C++ side using the macros defined in hifi\libraries\shared\src\Profile.h. Some of these have additional functionality, like setting the profile range color or recording additional information in a payload.