SF: Avoid allocation on hot path to IF
The number of layer stacks and listeners is small, and the predominant operations are lookup and iteration respectively, so store them on the stack contiguously to avoid hashing/allocation/indirection. Preallocate the WindowInfo and DisplayInfo vectors, since reallocating the former involves copying strings and fiddling with sp<> ref counts. Bug: 185536303 Test: simpleperf Test: WindowInfosListenerTest Change-Id: I5d1d1fc3b2639a4ee5056697e1a3581c11174173
Loading
Please register or sign in to comment