summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueThreadState.cpp
diff options
context:
space:
mode:
author Tim Murray <timmurray@google.com> 2019-12-10 17:23:52 -0800
committer Tim Murray <timmurray@google.com> 2020-02-07 10:00:17 -0800
commit52c2cab46d033b6218b2fd031c33acd0755967b4 (patch)
tree636c94af73feac982e4ff9f4655bb8a163f42783 /libs/gui/BufferQueueThreadState.cpp
parent5a377dd1be593ba62381f5509aba3564d7ef0797 (diff)
libui: rewrite Region with FatVector
Region is heavily used by SurfaceFlinger and the Android animation framework, but it uses the libutils Vector internally. libutils Vector allocates four elements via malloc() regardless of the contents of the Vector. However, Region is overwhelmingly a single-element Vector (occasionally two), which can be allocated on the stack easily enough. FatVector is an existing wrapper around std::vector that allows for a stack-allocated vector when the contents are small enough. Using FatVector in Region instead of libutils Vector avoids all of the malloc/free overhead, which improves SurfaceFlinger per-frame runtime by ~4%. This CL moves FatVector from libhwui to make it usable by Region. Test: boots, works, passes tests Bug: 149096186 Change-Id: I265c6c831bc82f31afe0d100aec2f98344f2390b
Diffstat (limited to 'libs/gui/BufferQueueThreadState.cpp')
0 files changed, 0 insertions, 0 deletions