Skip to content

Conversation

@stefanunity
Copy link
Collaborator

Description

Add 2 new performance tests measuring frame times of all profiler markers found in the package.

Changes made

  • one test where nothing at all happens
  • one test with keyboard and 4kHz mouse events

Testing

New tests run and seem stable.

Risk

None, just new tests

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

@stefanunity stefanunity changed the title Add: Two new performance tests measuring frame times NEW: Add two performance tests measuring frame times Oct 10, 2024
@stefanunity stefanunity marked this pull request as ready for review October 10, 2024 12:34
@stefanunity stefanunity requested a review from ekcoh October 10, 2024 12:35

Click(mouse.leftButton, queueEventOnly: true);

//mouse movements for higher polling mice (66*60 ~ 4kHz)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the for loop here should match the achievable event rate at the OS. So 66 here like you are using means 66 Hz. I think 500-1000 Hz is common as hardware sampling frequency. The maximum I have measured on my machine with a 8 kHZ mouse have been 5700 mouse events per second. Which means 95 mouse events per frame @60 Hz. So that would map to 95 here in this for. The outer for loop just means, lest simulate 500 frames.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
for (int i = 0; i < 500; ++i)
{
PressAndRelease(keyboard.wKey, queueEventOnly: true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand (compared to comment below), pressing W, A, S and D as well as shift and space and mouse button at a constant rate of e.g. 60 times per second is not very realistic? I would suggest to use a modulo operation here with a switch to do different input for each frame depending on a modulo computation, e.g. if (i % 60 == 0) PressSomething()
would mean I press something every 60th frame, which means once a second if playing at 60 Hz. If benchmark is targeting something specific (microbenchmark) it may make sense to stick to large data amount though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanunity stefanunity merged commit 0a39ee0 into develop Oct 24, 2024
77 checks passed
@stefanunity stefanunity deleted the performance/frame-time-test-trial branch October 24, 2024 14:21
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.

3 participants