Skip to content

Conversation

@acdlite
Copy link
Collaborator

@acdlite acdlite commented Nov 9, 2017

Helps detect starvation issues.

screen shot 2017-11-09 at 5 34 22 pm

Copy link
Contributor

@clemmy clemmy left a comment

Choose a reason for hiding this comment

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

}

export function startRequestCallbackTimer(): void {
if (enableUserTimingAPI && !isWaitingForCallback) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we keep this nested? I want to keep all top level conditions uniform so it's obvious they all have to include the enableUserTimingAPI flag check.

exports[`ReactDebugFiberPerf captures all lifecycles 1`] = `
"// Mount
"⚛ (Waiting for async callback...)
// Mount
Copy link
Collaborator

Choose a reason for hiding this comment

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

These comments are a bit confusing now. They were meant to be attached to the phases below. Any way we can avoid nesting them?

export function stopRequestCallbackTimer(didExpire: boolean): void {
if (enableUserTimingAPI) {
isWaitingForCallback = false;
const warning = didExpire ? 'Async work expired' : null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not very obvious to me what this means. Is there a way to phrase it in a more user-accessible way?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, let's think of something better. I was trying to keep it concise. What it means is:

"An async update starved because the main thread was blocked"

@acdlite acdlite force-pushed the warnonexpiration branch 2 times, most recently from 1ccf6b7 to c0a62af Compare November 9, 2017 18:25
@acdlite
Copy link
Collaborator Author

acdlite commented Nov 9, 2017

@gaearon What if I changed it to say "Warning: Main thread is blocked"? Is that clearer?

`${' '.repeat(activeMeasure.indent + 1)}// ${comment}`,
);
comments.push(comment);
// activeMeasure.children.push(
Copy link
Collaborator

Choose a reason for hiding this comment

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

?

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

Accept to unblock but let's make the message clearer and fix CI

@acdlite acdlite merged commit c580082 into facebook:master Nov 10, 2017
Ethan-Arrowood pushed a commit to Ethan-Arrowood/react that referenced this pull request Dec 8, 2017
…cebook#11506)

* Measure time between scheduling an async callback and flushing it

Helps detect starvation issues.

* Debug comments should print directly above the next measure

* Better warning message

Most users won't know what "expires" means
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants