Cache least recently used output buffer.
- reduce memory allocations especially when Xml is serialized inside a
tight inner loop,
- performance slightly improved.
BEFORE:
100 packages:
[2/4] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.516s)
timeWrite_Binary_mean: 674979
threadAllocCount_mean: 59
timeWrite_Binary_min: 671194
timeWrite_Binary_median: 674798
timeWrite_Binary_standardDeviation: 3658
threadAllocSize_mean: 530176
10 packages:
[2/4] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.542s)
timeWrite_Binary_mean: 71113
threadAllocCount_mean: 56
timeWrite_Binary_min: 70201
timeWrite_Binary_median: 71237
timeWrite_Binary_standardDeviation: 692
threadAllocSize_mean: 59136
1 package:
[2/4] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.091s)
timeWrite_Binary_mean: 15698
threadAllocCount_mean: 56
timeWrite_Binary_min: 15072
timeWrite_Binary_median: 15677
timeWrite_Binary_standardDeviation: 410
threadAllocSize_mean: 6439
AFTER:
100 packages:
[1/1] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.221s)
timeWrite_Binary_mean: 605862
threadAllocCount_mean: 53
timeWrite_Binary_min: 602353
timeWrite_Binary_median: 604424
timeWrite_Binary_standardDeviation: 4972
threadAllocSize_mean: 492748
10 packages:
[1/1] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.575s)
timeWrite_Binary_mean: 58710
threadAllocCount_mean: 50
timeWrite_Binary_min: 57551
timeWrite_Binary_median: 57798
timeWrite_Binary_standardDeviation: 2129
threadAllocSize_mean: 21696
1 package:
[1/1] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.151s)
timeWrite_Binary_mean: 11576
threadAllocCount_mean: 50
timeWrite_Binary_min: 11315
timeWrite_Binary_median: 11381
timeWrite_Binary_standardDeviation: 431
threadAllocSize_mean: 4336
Test: atest FastDataPerfTest XmlPerfTest
Bug: 195994150
Fixes: 195994150
Merged-In: Ieedd27a676d718967c2fac30bc48a68ae636a180
Change-Id: Ieedd27a676d718967c2fac30bc48a68ae636a180
3 files changed