diff options
author | Danny Lin <danny@kdrag0n.dev> | 2021-04-06 15:55:54 -0700 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2022-05-05 00:39:05 +0800 |
commit | f0c82a4ec66521d0fa0fe236599d740e43df1b3e (patch) | |
tree | 2f048a6f7c647195cf15df4493091a76c60fbe1d /core | |
parent | 0a0bd75bfdd8e9e3c01fd8ce556654bc3f6e7939 (diff) |
Revert "Pre-emptively take a snapshot when finishing an activity before changing visibility"
This reverts commit 6dad90e5883db82c345a3ab592b26f0fd69fe28d.
When opening and closing activities in Settings, a significant amount of
CPU time is spent rendering and compressing JPEG screenshots, as
reported by simpleperf:
0.46% /system/lib64/libjpeg.so encode_mcu_gather
0.37% /system/lib64/libhwui.so neon::S32_alpha_D32_filter_DX(SkBitmapProcState const&, unsigned int const*, int, unsigned int*)
0.29% /system/lib64/libjpeg.so jsimd_extrgbx_ycc_convert_neon
0.27% /system/lib64/libjpeg.so jsimd_fdct_islow_neon
0.23% /system/lib64/libjpeg.so jsimd_huff_encode_one_block_neon
0.14% /system/lib64/libjpeg.so jsimd_quantize_neon
Call graph tracing reveals that TaskSnapshotPersister is responsible for
taking the screenshots:
0.16% 0.16% /system/lib64/libjpeg.so encode_mcu_gather
|
-- encode_mcu_gather
|
--50.00%-- compress_output
process_data_simple_main
jpeg_write_scanlines
SkJpegEncoder::onEncodeRows(int)
SkJpegEncoder::Encode(SkWStream*, SkPixmap const&, SkJpegEncoder::Options const&)
SkEncodeImage(SkWStream*, SkPixmap const&, SkEncodedImageFormat, int)
android::Bitmap::compress(SkBitmap const&, android::Bitmap::JavaCompressFormat, int, SkWStream*)
android::Bitmap::compress(android::Bitmap::JavaCompressFormat, int, SkWStream*)
Bitmap_compress(_JNIEnv*, _jobject*, long, int, int, _jobject*, _jbyteArray*)
art_jni_trampoline
android.graphics.Bitmap.compress
com.android.server.wm.TaskSnapshotPersister$StoreWriteQueueItem.writeBuffer
com.android.server.wm.TaskSnapshotPersister$StoreWriteQueueItem.write
com.android.server.wm.TaskSnapshotPersister$1.run
art_quick_invoke_stub
art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)
art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)
art::Thread::CreateCallback(void*)
__pthread_start(void*)
__start_thread
Manual code tracing leads to ActivityRecord as the culprit, as it takes
a screenshot every time an Activity is finished. This doesn't appear to
be critical, so revert the commit that added it in order to reduce
excess CPU usage.
Test: simpleperf record -a; verify that libjpeg-turbo no longer appears
in top sample hits
Change-Id: Ib161679f1f3b83787f90b8ef7dcf46d246bb7c57
Diffstat (limited to 'core')
0 files changed, 0 insertions, 0 deletions