Manually release objects in testDeserializeFontMap.
Before this CL, the latency numbers (esp. p90 and p95) are affected by the number of test iterations [1]. With more test iteration, stddev increases (instead of dropping). It is suspected that this is due to GC running during test to reclaim Typeface objects and release underlying native objects. The latency numbers are more stable [2] when we release the native objects manually outside measured segment. [1] testDeserializeFontMap before this CL on oriole ==== TARGET_TEST_DURATION_NS = 500ms ==== [1/1] android.graphics.perftests.TypefaceSerializationPerfTest#testDeserializeFontMap: PASSED (9.324s) testDeserializeFontMap_mean (ns): 183206 testDeserializeFontMap_median (ns): 180155 testDeserializeFontMap_percentile90 (ns): 209350 testDeserializeFontMap_percentile95 (ns): 213460 testDeserializeFontMap_stddev (ns): 41002 ==== TARGET_TEST_DURATION_NS = 5000ms ==== [1/1] android.graphics.perftests.TypefaceSerializationPerfTest#testDeserializeFontMap: PASSED (14.322s) testDeserializeFontMap_mean (ns): 202022 testDeserializeFontMap_median (ns): 190185 testDeserializeFontMap_percentile90 (ns): 240560 testDeserializeFontMap_percentile95 (ns): 253540 testDeserializeFontMap_stddev (ns): 93062 [2] testDeserializeFontMap with this CL on oriole ==== TARGET_TEST_DURATION_NS = 500ms ==== [1/1] android.graphics.perftests.TypefaceSerializationPerfTest#testDeserializeFontMap: PASSED (9.224s) testDeserializeFontMap_mean (ns): 121483 testDeserializeFontMap_median (ns): 118001 testDeserializeFontMap_percentile90 (ns): 122233 testDeserializeFontMap_percentile95 (ns): 125448 testDeserializeFontMap_stddev (ns): 51197 ==== TARGET_TEST_DURATION_NS = 5000ms ==== [1/1] android.graphics.perftests.TypefaceSerializationPerfTest#testDeserializeFontMap: PASSED (13.361s) testDeserializeFontMap_mean (ns): 120750 testDeserializeFontMap_median (ns): 119344 testDeserializeFontMap_percentile90 (ns): 124064 testDeserializeFontMap_percentile95 (ns): 127441 testDeserializeFontMap_stddev (ns): 15181 Bug: 239758440 Test: atest CorePerfTests:android.graphics.perftests.TypefaceSerializationPerfTest#testDeserializeFontMap Change-Id: Ia445300b1a872f51dadad38a0f063d5097c52779
Loading
Please register or sign in to comment