Skip to content

Benchmarking & stress testing OpenRCT2

Margen67 edited this page Apr 20, 2021 · 4 revisions

Google Benchmark

With #8458 there is support for the Google Benchmark library. The initial benchmark implemented measures performance of the sprite sorting algorithm. You should be able to use all of the library's options:

[--benchmark_list_tests={true|false}]
[--benchmark_filter=<regex>]
[--benchmark_min_time=<min_time>]
[--benchmark_repetitions=<num_repetitions>]
[--benchmark_report_aggregates_only={true|false}]
[--benchmark_format=<console|json|csv>]
[--benchmark_out=<filename>]
[--benchmark_out_format=<json|console|csv>]
[--benchmark_color={auto|true|false}]
[--benchmark_counters_tabular={true|false}]
[--v=<verbosity>]

You're welcome to experiment with code to improve it and add more benchmarks.

benchspritesort

This is a benchmark measuring performance of the sprite sorting algorithm. To use, invoke ./openrct2 benchspritesort [save.sv6]....

benchgfx

To benchmark park rendering, run openrct2 benchgfx path/to/file.sv6 [optional iteration count]. By default 40 iterations are performed, but you can change this by passing a third parameter (e.g. openrct2 benchgfx save.sv6 100 would run 100 iterations).

We provide a test park containing every ride type in the tests folder - test/tests/testdata/parks/bpb.sv6 (link). It's based on Blackpool Pleasure Beach from RCT1.

Another park frequently used for benchmarking or stress-testing is Adventuredome Atlantic City from NEDesigns (frequently known as 'the dome park'). This has a bunch of rides under a glass dome, which requires a lot of work to render (open the 'roof on' version in the download).

Clone this wiki locally