From 7e384575d1915ce24d5286100f4a04807f1a4ab4 Mon Sep 17 00:00:00 2001 From: baalajimaestro Date: Tue, 24 Sep 2024 04:55:24 +0200 Subject: [PATCH] sky: Prop: Optimize dex flags This is a squash of the following commits: 1. Optimise dex flags for a faster boot * Used multiple threads and speed profile to hasten the first boot Signed-off-by: baalajimaestro Change-Id: I2cce5ddf7d50308511e81436fcac613b2c6537bf 2. Rework dex flags again When I went through https://source.android.com/devices/tech/dalvik/configure my previous configs felt wrong, this one should be perfect (I hope). Even though there is a slight trade-off for boot time by using the speed profile, we do make up for it by using 8 threads. PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER attempts to compile all prebuilts fully optimised to speed level, thus the phone doesnt need to deal with it. I also do know that this might be a trade-off on size, but I do see the first boot time is more worthy to trade-off. The speed level mentioned here runs dex verification and compiles all AOT methods. Signed-off-by: baalajimaestro Signed-off-by: Omkar Chandorkar Change-Id: Ic0156ff8956a7c5f53820be6db438f6f6399d3c0 3. Switch certain dexopt profiles to verify Prebuilt apps like Gmail/Google App, will be updated by google play, and there is no need spend time and space optimising what is going to be replaced. Switch to Google's recommendation of using verify for an OTA package. Applications still stay on speed. Instead, replace the install profile with speed-profile making apps perform better. Signed-off-by: baalajimaestro Change-Id: I2cce5ddf7d50308511e81436fcac613b2c6537bf --- configs/properties/vendor.prop | 10 ++++++++++ device.mk | 3 +++ 2 files changed, 13 insertions(+) diff --git a/configs/properties/vendor.prop b/configs/properties/vendor.prop index f9b2905..2749e91 100644 --- a/configs/properties/vendor.prop +++ b/configs/properties/vendor.prop @@ -209,6 +209,16 @@ persist.vendor.dpm.vndr.feature=1 # DRM drm.service.enabled=true +# Dex2oat +pm.dexopt.boot=verify +pm.dexopt.first-boot=verify +pm.dexopt.install=speed-profile +dalvik.vm.image-dex2oat-filter=speed +dalvik.vm.image-dex2oat-threads=8 +dalvik.vm.dex2oat-filter=speed +dalvik.vm.dex2oat-threads=8 +dalvik.vm.dex2oat64.enabled=true + # Fingerprint ro.hardware.fp.sideCap=true diff --git a/device.mk b/device.mk index 5b528bf..fc6538b 100644 --- a/device.mk +++ b/device.mk @@ -146,6 +146,9 @@ PRODUCT_COPY_FILES += \ PRODUCT_SYSTEM_EXT_PROPERTIES += \ persist.lcd.cabc_mode=1 +# Dex +PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER := verify + # Display PRODUCT_PACKAGES += \ android.hardware.graphics.mapper@4.0-impl-qti-display \