profiler icon indicating copy to clipboard operation
profiler copied to clipboard

Nested jank markers are confusing

Open fqueze opened this issue 5 years ago • 2 comments

Example profile: https://share.firefox.dev/3mtg0JD

Capture d’écran 2020-10-26 à 19 54 00

Quick discussion with the team gives me the impression that this isn't the intended behavior.

fqueze avatar Oct 26 '20 18:10 fqueze

Which jank markers would you expect in this example?:

function blockFor100msAndRequeue() {
  sleep(100);
  queueTask(blockFor100msAndRequeue);
}

// Start with three tasks in the queue.
queueTask(blockFor100msAndRequeue);
queueTask(blockFor100msAndRequeue);
queueTask(blockFor100msAndRequeue);

// The first queued task starts executing now.

In this example, there are two tasks in the queue at all times, and one of them is executing. So, at any point where you want to queue some other event, that event needs to wait for 200ms-300ms before it starts executing. What's the jank duration? Is it 100ms? Is it 300ms? Is it "until the event loop is empty again"?

mstange avatar Feb 23 '22 15:02 mstange

I believe our current expectation is how the browser reacts to user input.

BTW I'm not sure what you mean with task here, is that macro tasks (in that case I believe we would be able to react between tasks) or micro tasks (in that case we would never yield to repaint/redraws)?

julienw avatar Feb 24 '22 14:02 julienw

Also :dholbert filed a bug for that in bugzilla here: https://bugzilla.mozilla.org/show_bug.cgi?id=1829955 .

canova avatar Apr 27 '23 12:04 canova