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

Adds Draw benchmarking support #3802

Draft
wants to merge 4 commits into
base: v2_develop
Choose a base branch
from
Draft

Conversation

tig
Copy link
Collaborator

@tig tig commented Oct 24, 2024

This PR backports some drawing benchmark stuff from

to quantify how much improvement I'm making.

Proposed Changes/Todos

  • Add support to ConsoleDriver for tests to see how often draw code is called.
  • Add an All_Scenarios_Time unit test that measures how each Scenario performs w.r.t draw calls.

The results are pretty horrific.

For example.

Scenario UICatalog.Scenarios.AllViewsTester
  took 20827 ms to run.
  called Driver.ClearContents 0 times.
  called Driver.Refresh 5004 times.
    which updated the screen 5003 times.

Scenario UICatalog.Scenarios.Generic
  took 4659 ms to run.
  called Driver.ClearContents 0 times.
  called Driver.Refresh 5004 times.
    which updated the screen 5003 times.

Scenario UICatalog.Scenarios.Progress
  took 12300 ms to run.
  called Driver.ClearContents 0 times.
  called Driver.Refresh 5004 times.
    which updated the screen 5003 times.

In #3798:

Scenario UICatalog.Scenarios.AllViewsTester
  took 91 ms to run.
  called Driver.ClearContents 1 times.
  called Driver.Refresh 5003 times.
    which updated the screen 1 times.

Scenario UICatalog.Scenarios.Generic
  took 16 ms to run.
  called Driver.ClearContents 0 times.
  called Driver.Refresh 5003 times.
    which updated the screen 1 times.

Scenario UICatalog.Scenarios.Progress
  took 84 ms to run.
  called Driver.ClearContents 0 times.
  called Driver.Refresh 5003 times.
    which updated the screen 1 times.

@tig
Copy link
Collaborator Author

tig commented Oct 24, 2024

More...

Before:

Scenario UICatalog.Scenarios.Buttons
  took 2271 ms to run.
  called Driver.ClearContents 0 times.
  called Driver.Refresh 1004 times.
    which updated the screen 1003 times.
  called View.Draw 22044 times.

After:

Scenario UICatalog.Scenarios.Buttons
  took 82 ms to run.
  called Driver.ClearContents 1 times.
  called Driver.Refresh 1003 times.
    which updated the screen 1 times.
  called View.Draw 41 times.

@tig
Copy link
Collaborator Author

tig commented Oct 24, 2024

These new tests expose some really bad behavior in a bunch of Views and Scenarios...

Most of which are caused by the API being unclear, which I'm fixing in #3798

@tznind
Copy link
Collaborator

tznind commented Oct 24, 2024

Nice! this will make a huge improvement in performance! Thats like 20x less!

❤️

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.

2 participants