Skip to content
Snippets Groups Projects
Commit e8a7ab25 authored by Patrick Williams's avatar Patrick Williams
Browse files

Improve updateInputFlinger performance

This change improves the performance of the WindowInfosListenerInvoker work done on SurfaceFlinger's background executor thread. The primary optimization made is not sending a WindowInfosReportedListener with every call to WindowInfosListener.onWindowInfosChanged. Instead, we send a new interface, WindowInfosPublisher, and a unique listener id to listeners when they're added.  Listeners call WindowInfosPublisher.ackWindowInfosReceived with their id after processing each update.

From traces taken during development, the new code is a major improvement, taking about 15% of the time spent previously on SurfaceFlinger's background thread for sending window infos. Performance with this change seems roughly in line with the performance in T.

Bug: 290377931
Test: atest WindowInfosListenerTest
Test: atest WindowInfosListenerInvokerTest
Test: manually killing system server and checking valid state on restart
Change-Id: Ib39ba935727df0bc1ab4030bcfe8301de7e64805
(cherry picked from commit acd2258a)
parent 96d0d965
No related branches found
No related tags found
No related merge requests found
Showing
with 333 additions and 242 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment