Fix Draw benchmark behavior, add FPS benchmark #258
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "Added separate benchmark for 'Draws per second' as opposed to existing 'Frames per second'"
Purpose of change
This came up in #251.
After migration to
ui_adaptor
, "Draw benchmark (X seconds)" went from measuring number of redraws (g->draw()
) per second to number of redraws + window refreshes (g->draw()
+refresh_window()
) per second. Window refresh is a blocking operation, with block time depending on the OS, and therefore may skew with the benchmark results.This PR reverts the behavior of the "Draw benchmark" back to how it worked before the migration, and adds "FPS benchmark" that retains the current behavior.
Describe the solution
Changed the code to call
refresh_window()
only when measuring FPS.Also, moved popup creation out of measuring code (!!!), and made the game actually display it during draw benchmark.
Describe alternatives you've considered
Just removing
refresh_window()
call, but then I realized that FPS benchmark may be useful too.Testing
With
opengl
renderer, my Kubuntu 20.04 caps FPS benchmark at 60 (due to synchronization), but Draw benchmark shows 140.