Settings open slowly (Pixel XL, Android 8)
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.
I think it's LocaleListPreference.buildList() that is taking quite long.
@bbinto should this be in folly? was removed from cobalt.
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?!?
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
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.
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 Nice find! Please open a PR and add a comment explaining why we do this. :)
@pocmo will do in the evening when I get home.
@pocmo I've made a PR.
Awesome. Thank you!