LocklessQueue: move values into Entries instead of copying.
The motivation for this change is b/408710034 where the allocator crashes while copying a value into a LocklessQueue Entry, but there is also a performace win: BM before: ``` ---------------------------------------------------------- Benchmark Time CPU Iterations ---------------------------------------------------------- pushPop/1 41.9 ns 41.9 ns 16696378 pushPop/8 38.6 ns 38.6 ns 18191833 pushPop/64 42.9 ns 42.9 ns 16353414 pushPop/512 86.1 ns 86.0 ns 8216985 pushPop/4096 705 ns 705 ns 997754 pushPop/32768 6162 ns 6157 ns 110737 pushPop/262144 57837 ns 57780 ns 12010 pushPop/1048576 227840 ns 227688 ns 3137 ``` BM this change: ``` ---------------------------------------------------------- Benchmark Time CPU Iterations ---------------------------------------------------------- pushPop/1 26.8 ns 26.8 ns 26163075 pushPop/8 25.1 ns 25.1 ns 27890003 pushPop/64 25.9 ns 25.9 ns 27154234 pushPop/512 25.7 ns 25.7 ns 27187823 pushPop/4096 25.7 ns 25.7 ns 27187548 pushPop/32768 25.9 ns 25.8 ns 27118373 pushPop/262144 25.9 ns 25.8 ns 27081835 pushPop/1048576 25.9 ns 25.9 ns 27164591 ``` Test: `BM=surfaceflinger_microbenchmarks_host_supported; m $BM && $ANDROID_HOST_OUT/benchmarktest64/$BM/$BM` ; presubmit Flag: EXEMPT refactor Bug: 408710034 Change-Id: Iad975257c7db2a7fff1441b43847c36493cadc01
Loading
Please register or sign in to comment