Benchmarks
- Dominant language
- Lua
- Stars
- 264
- Forks
- 260
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 21
Description
Description
-----------
The repository contains various [benchmarks](https://github.com/FAForever/fa/tree/deploy/fafdevelop/lua/benchmarking/benchmarks). At the moment it requires [a mod](https://gitlab.com/supreme-commander-forged-alliance/other/profiler) to run these benchmarks. The mod is not intuitive to use.
The profiler window has a tab preserved for benchmarks. This tab needs to become functional.
Course of action
----------------
The content of the panel would be roughly the following:

_10/10 drawing of the idea_
On the left side there is:
- A button to find all benchmarks (that are in the benchmark folder)
- A drop down to choose a file with benchmarks
- A drop down to choose a function from the file of benchmarks
- A button to run the benchmark
On the right side there is:
- The time taken to run the benchmark
- The byte code of the benchmark
The profiler is split over three components:
- The [sim-side](https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/sim/Profiler.lua) of the profiler
- The [ui-side](https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/ui/game/Profiler.lua) of the profiler
- The [shared components](https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/shared/Profiler.lua) between ui and sim of the profiler
On the sim side the running of benchmarks is already implemented. See the functions [FindBenchmarks](https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/sim/Profiler.lua#L164) and [RunBenchmarks](https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/sim/Profiler.lua#L253). The information needs to be synced to the UI side. The information needs to be stored on the UI side. And the UI side needs to be able to visualize the information.
The profiler is written using a class structure as introduced by @4z0t . Please adhere to it.
Test plan
---------
This should be one pull request. The pull request will solely implement the benchmarking functionality as described. It should therefore at a minimum support:
- Searching for files with benchmarks
- Being able to run benchmarks
- Being able to see the results of benchmarks
And above all, it should be friendly to use. This will be the primary tool to understand how certain aspects of the game impact performance. As an example, it would be great if it recalls the selection of the second drop box when you change the selection of the first drop box.
Contributor guide
Assessment
This issue has not been assessed yet.