Skip to content

Add RAF and setTimout based testRun initiation - #116

Closed
camillobruni wants to merge 3 commits into
WebKit:mainfrom
camillobruni:2023-03-21_async_prep
Closed

camillobruni wants to merge 3 commits into
WebKit:mainfrom
camillobruni:2023-03-21_async_prep

Conversation

@camillobruni

@camillobruni camillobruni commented Mar 21, 2023 •

Copy link
Copy Markdown
Contributor

Seems like a lot of the perf different isn't coming actually from the change in the async measurements but rather in using RAF to start the test.
This PR adds params.testInitiator to change the mode for local investigation.

RAF-based test initiation seems to decrease the score by 15% on Chrome, by 25% on Safari and 4% on Firefox, which is rather unexpected.

Comment thread resources/benchmark-runner.mjs Outdated
await this._client.willRunTest(suite, test);
const runTest = this._runTest.bind(this, suite, test, this._page, resolve);
if (params.testInitiator === "raf")
window.requestAnimationFrame(runTest);

@smaug---- smaug---- Mar 21, 2023 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This isn't doing what we were discussing, or am I missing something. The idea was to have two raf callbacks for the same raf time. The first one would run the sync part of the test, the second one would capture the end time of the sync test (that way promise callbacks are part of the sync testing) and then the second raf callback would trigger setTimeout(,0) which records async time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

correct, this is separate. I just realised that this part of my original PR had a massive performance impact, and I'd like to understand why. I think it would make sense to start each sub-tests with an empty task / microtask queue to limit the unmeasured overhead. This I think using an RAF to initiate the test might be a good idea.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this the original PR #28 you're referring to or is it something else? Trying to understand what the final form might look like

@camillobruni

Copy link
Copy Markdown
Contributor Author

Merging everything back to PR #28 .

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