Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Draw benchmark behavior, add FPS benchmark #258

Merged
merged 1 commit into from Dec 11, 2020
Merged

Fix Draw benchmark behavior, add FPS benchmark #258

merged 1 commit into from Dec 11, 2020

Conversation

olanti-p
Copy link
Member

@olanti-p olanti-p commented Dec 10, 2020

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.

@olanti-p olanti-p changed the title Add separate benchmark for 'Draws per second' Fix Draw benchmark behavior, add FPS benchmark Dec 10, 2020
@Coolthulhu
Copy link
Member

Some of the compilers complain about missing declaration.
Do you have access to Travis build results from here?

@olanti-p
Copy link
Member Author

olanti-p commented Dec 11, 2020

I do. Fixed it (hopefully).

@Coolthulhu Coolthulhu merged commit cb2d3a4 into cataclysmbnteam:upload Dec 11, 2020
@Coolthulhu
Copy link
Member

Damn, I'm getting really poor FPS on those. Could be just my (profiled) builds, but still, 30 FPS on a 2D game is pathetic.

@olanti-p
Copy link
Member Author

Yeah. I had to zoom in and resize the window to minimum to get it up to 60/140, normally it's 25-35.

@olanti-p olanti-p deleted the split-bench branch December 11, 2020 12:37
@Coolthulhu
Copy link
Member

I'm reading cata_tiles::draw and it looks like calling it a drawing benchmark would be misleading: most of the function (by CPU usage) is actually recalculating vision cache.

@olanti-p
Copy link
Member Author

olanti-p commented Dec 11, 2020

Dunno. It doesn't take (on Windows 10 x64, with software renderer) very much:
image
Unlike, say, the minimap:
image
Which is somewhat better with direct3d11:
image
The duplicate map cache rebuild also seems to be costly - I believe DDA had a bunch of PRs dealing with it
image

@Coolthulhu
Copy link
Member

with software renderer

On Linux+opengl, I'm not seeing any draw calls in top 10 of gprof output. Though I'm not sure how trustworthy is it.

The duplicate map cache rebuild also seems to be costly - I believe DDA had a bunch of PRs dealing with it

Probably worth grabbing, I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants