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

Profiling

Daosheng Mu edited this page Nov 15, 2019 · 3 revisions

Tool

webgfx-tests

For profiling performance questions that are related to WebGL and WebVR in Firefox Reality, webgfx-tests is a good choice. This tool helps us compare the performance difference between the changes you made and before your changes. To run this profiler, there are a few steps as below.

  1. Pull webgfx-tests, install it by npm install -g webgfx-tests.
  2. Getting your device id by webgfx-tests list-devices, and you will see the serial number of your device.
  3. Getting your available browsers by webgfx-tests list-browsers --adb. You should be able to see fxr in your console.
Browsers on device: xxx (serial: XXXXXXXXX)
-----------------------------------------------------
fxr
-----------------------------------------------------
  1. Then, we need to select a test to run. Check webgfx-tests/examples/tests/tests.json, find a test you want to run, and do some changes on its configuration to allow it run in the immersive mode automatically.
"interactive": false,
"autoenterXR": true,
"skipReferenceImageTest": true

For a quick start, webvr_info_3 is a good one for taking a try.

  1. Running a profiling,

webgfx-tests run {%TEST_ID%} -a {%YOUR_DEVICE_SN%} -b fxr -c {%YOUR_CONFIG_FILE_PATH%} -o {%OUTPUT_FILE%} -n {%TIMES%}

TEST_ID: One of test ids from webgfx-tests/examples/tests/tests.json, e.g. webvr_info_3.

YOUR_DEVICE_SN: This is your serial number you get from webgfx-tests list-devices.

YOUR_BROWSER: Assign this test to be run in which browser. e.g. fxr.

YOUR_CONFIG_FILE_PATH: Assign a config file, e.g. ./examples/tests/webgfx-tests.config.json.

OUTPUT_FILE: Output the profiling result into a text file. ex: result.json.

TIMES: Run the same test for a few times. e.g. 5.

Then, you might have your own developer build version of Firefox Reality, run the same command as above, the make it dump the result to another file, like result1.json.

  1. Finally, to do comparison between these two versions of builds by group by these two result files via webgfx-tests summary {%OUTPUT_FILE_1%} {%OUTPUT_FILE_2%} --groupby file.
Clone this wiki locally