Optimise loading wallpaper from disk to memory using chunks.
Before this optimisation, target user's image wallpaper was being read from disk to memory one byte at a time, which was causing too much CPU consumption and slowness. With this CL, that process is optimised by reading in 8 KB chunks via using the readAllBytes() function. This CL decreases the average core (without the animations) user switch duration by 32%, from 815.69ms to 556.66ms on a high end tablet device. Impact is expected to be higher on lower end devices. This CL also halves the memory consumtion since byte array is no more getting duplicated. Bug: 316331405 Test: Perfetto trace comparison Flag: NONE Change-Id: I1d6e556e51b0f81e18174f77edfc85ef7d8bb62a
Loading
Please register or sign in to comment