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
Showing
- libs/gui/Android.bp 3 additions, 0 deletionslibs/gui/Android.bp
- libs/gui/WindowInfosListenerReporter.cpp 12 additions, 8 deletionslibs/gui/WindowInfosListenerReporter.cpp
- libs/gui/aidl/android/gui/ISurfaceComposer.aidl 3 additions, 1 deletionlibs/gui/aidl/android/gui/ISurfaceComposer.aidl
- libs/gui/aidl/android/gui/WindowInfosListenerInfo.aidl 25 additions, 0 deletionslibs/gui/aidl/android/gui/WindowInfosListenerInfo.aidl
- libs/gui/android/gui/IWindowInfosListener.aidl 1 addition, 3 deletionslibs/gui/android/gui/IWindowInfosListener.aidl
- libs/gui/android/gui/IWindowInfosPublisher.aidl 23 additions, 0 deletionslibs/gui/android/gui/IWindowInfosPublisher.aidl
- libs/gui/fuzzer/libgui_fuzzer_utils.h 2 additions, 2 deletionslibs/gui/fuzzer/libgui_fuzzer_utils.h
- libs/gui/include/gui/ISurfaceComposer.h 1 addition, 0 deletionslibs/gui/include/gui/ISurfaceComposer.h
- libs/gui/include/gui/WindowInfosListenerReporter.h 5 additions, 3 deletionslibs/gui/include/gui/WindowInfosListenerReporter.h
- libs/gui/tests/Surface_test.cpp 2 additions, 1 deletionlibs/gui/tests/Surface_test.cpp
- services/surfaceflinger/BackgroundExecutor.cpp 14 additions, 0 deletionsservices/surfaceflinger/BackgroundExecutor.cpp
- services/surfaceflinger/BackgroundExecutor.h 1 addition, 0 deletionsservices/surfaceflinger/BackgroundExecutor.h
- services/surfaceflinger/SurfaceFlinger.cpp 7 additions, 7 deletionsservices/surfaceflinger/SurfaceFlinger.cpp
- services/surfaceflinger/SurfaceFlinger.h 4 additions, 3 deletionsservices/surfaceflinger/SurfaceFlinger.h
- services/surfaceflinger/WindowInfosListenerInvoker.cpp 130 additions, 123 deletionsservices/surfaceflinger/WindowInfosListenerInvoker.cpp
- services/surfaceflinger/WindowInfosListenerInvoker.h 20 additions, 15 deletionsservices/surfaceflinger/WindowInfosListenerInvoker.h
- services/surfaceflinger/tests/unittests/WindowInfosListenerInvokerTest.cpp 80 additions, 76 deletions...linger/tests/unittests/WindowInfosListenerInvokerTest.cpp
Loading
Please register or sign in to comment