Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8994c180 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Steven Moreland
Browse files

Collect Parcel statistics using std::atomics.

Instead of using a heavy pthread_mutex_t for updating size and count
statistics, this change shifts to using faster std::atomic values,
an approach that was already pioneered over in hardware::Parcel.

The Parcel benchmarks referenced below are showing a ~10% perf
improvement for contended cases.  Note that this is in addition to
the improvements recently made with the shift to a linked-list
pooling design, and removal of advisory native allocation updates.

Here's the combined improvements of all three changes together;
~2x throughput for the 1-thread case, and ~9x throughput for the
16-thread case.

              1 thread   4 threads   16 threads
Combined        50.48%      15.58%       11.41%

Bug: 165032569
Test: ./frameworks/base/libs/hwui/tests/scripts/prep_generic.sh little && atest CorePerfTests:android.os.ParcelObtainPerfTest
Change-Id: I436e70cdfd06e747d5c8fcc0ddd6ecf92737cf9c
Merged-In: I436e70cdfd06e747d5c8fcc0ddd6ecf92737cf9c
parent 3d67213a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment