focus-android icon indicating copy to clipboard operation
focus-android copied to clipboard

Settings open slowly (Pixel XL, Android 8)

Open pocmo opened this issue 9 years ago • 10 comments

On my Pixel XL running Android 8 it takes about 4 seconds until the settings show up after clicking the menu item. That's super slow and feels like the app is frozen.

pocmo avatar Aug 23 '17 10:08 pocmo

I think it's LocaleListPreference.buildList() that is taking quite long.

pocmo avatar Sep 04 '17 10:09 pocmo

@bbinto should this be in folly? was removed from cobalt.

jenn-chaulk avatar Sep 18 '17 17:09 jenn-chaulk

Makes sense, I wonder why it was removed from Cobalt? I can't remember, expect all eyes were supposed to be on finishing the multitasking feature?!?

bbinto avatar Sep 19 '17 11:09 bbinto

Yes, it took about 2 seconds for app to launch settings menu! but when I start the app from quick launch and then open settings, it responds quickly!

My device : Oneplus 5 Android O

shikhart98 avatar Apr 18 '18 04:04 shikhart98

I dug a bit into this and it seems that lag is happening because OS instantiates Transliterator to convert the first letter of Ελληνικά locale to upper case see here

Maybe we can check if it's already uppercased and skip this step? If so, I can send a PR.

aperfilyev avatar Jul 08 '18 17:07 aperfilyev

The time of building a list went down from ~1800 ms to ~90 on my device. Thinking about it further we can certainly offload this method to a background thread.

aperfilyev avatar Jul 09 '18 06:07 aperfilyev

@aperfilyev Nice find! Please open a PR and add a comment explaining why we do this. :)

pocmo avatar Jul 09 '18 09:07 pocmo

@pocmo will do in the evening when I get home.

aperfilyev avatar Jul 09 '18 10:07 aperfilyev

@pocmo I've made a PR.

aperfilyev avatar Jul 09 '18 20:07 aperfilyev

Awesome. Thank you!

pocmo avatar Jul 10 '18 08:07 pocmo