Closed Bug 1697585 Opened 3 years ago Closed 3 years ago

Making input tasks more strictly aligned with vsync

Categories

(Core :: Performance, task)

task

Tracking

()

RESOLVED FIXED
89 Branch
Performance Impact none
Tracking Status
firefox89 --- fixed

People

(Reporter: sefeng, Assigned: sefeng)

References

Details

Attachments

(6 files)

The idea is to be able to handle more input tasks before vsync, and doing fewer input tasks while vsync.

Summary: Making input tasks more strictly alignment with vsync → Making input tasks more strictly aligned with vsync
Depends on: 1698643

Introduce a new TaskManager called HighPriorityTaskManager for
EventQueuePriority::High tasks.

This patch introduces a new way to way to schedule input tasks, such
that input tasks remain at InputHigh priority normally, however, when
there's a pending High priority task (Vsync tasks) in the task queue, we
increase the priority of input tasks from InputHigh to Vsync to
process the pending input tasks.

There are two restrictions to ensure we don't delay vsync too much:

  • There's a hard limit duration
  • We won't process the input tasks that are newly added after we've
    started to process the current number of input tasks

Depends on D109498

Attachment #9211022 - Attachment description: WIP: Bug 1697585 - Add HighPriorityTaskManager r=bas,smaug → Bug 1697585 - Add HighPriorityTaskManager r=bas,smaug
Attachment #9211023 - Attachment description: WIP: Bug 1697585 - Make input tasks can be more strictly aligned with Vsync r=bas,smaug → Bug 1697585 - Make input tasks can be more strictly aligned with Vsync r=bas,smaug

High priority is being used for vsync tasks, so we should rename it to
make it clear, and renaming it also makes our priority naming less
confusing.

Attachment #9211022 - Attachment description: Bug 1697585 - Add HighPriorityTaskManager r=bas,smaug → Bug 1697585 - Add VsyncTaskManager r=bas,smaug
Attachment #9211023 - Attachment description: Bug 1697585 - Make input tasks can be more strictly aligned with Vsync r=bas,smaug → Bug 1697585 - Make input tasks can be more strictly aligned with Vsync r=smaug

Some tests need to wait for a full tick cycle to ensure the expected
input tasks are run.

Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/074ebebaee27
Rename high priority to vsync priority r=smaug
https://hg.mozilla.org/integration/autoland/rev/0b1bc6cb84af
Add VsyncTaskManager r=bas,smaug
https://hg.mozilla.org/integration/autoland/rev/d8516aec6a5e
Make input tasks can be more strictly aligned with Vsync r=smaug
https://hg.mozilla.org/integration/autoland/rev/bc271f42bcb7
Add a test to ensure the correct order between input tasks and normal tasks when there's no pending vsync r=smaug
https://hg.mozilla.org/integration/autoland/rev/e9e4a710e7d1
Ask some tests to wait for a tick in browser_click_event_during_autoscrolling.js r=smaug

Currently, for auto scroller, when a mousedown happens, a possible run order is that
mousedown(parent process) -> scroll stopped (parent process) ->
mousedown(child process), so that the last mousedown(child process)
would start the scrolling again.

This patch adds a new check to the last mousedown(child process)
handler, to not starting the scrolling again if preventClickEvent has
been called on this event.

Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8ed6175e0c7b
Rename high priority to vsync priority r=smaug
https://hg.mozilla.org/integration/autoland/rev/4031cca20f28
Add VsyncTaskManager r=bas,smaug
https://hg.mozilla.org/integration/autoland/rev/c206669072a4
Make input tasks can be more strictly aligned with Vsync r=smaug
https://hg.mozilla.org/integration/autoland/rev/ca2243d8f565
Add a test to ensure the correct order between input tasks and normal tasks when there's no pending vsync r=smaug
https://hg.mozilla.org/integration/autoland/rev/eebe83ba4c97
Ask some tests to wait for a tick in browser_click_event_during_autoscrolling.js r=smaug
https://hg.mozilla.org/integration/autoland/rev/0ce8cafaccaf
Prevent starting scrolling again in the child process if preventClickEvent has been called r=masayuki,smaug
Blocks: 1705392
Flags: needinfo?(sefeng)
Blocks: 1714467
Performance Impact: --- → -
Whiteboard: [qf-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: