The app I'm working on provides several layout resources for different orientation configurations: layout-land; layout-land-mdpi; layout-land-hdpi, etc.
I've noticed that the performance degrades when the platform has to choose from three alternatives - it loads the layout at average of 494 ms (from 5 attempts).
On the other hand when I define the layout only in 'res/layout' I've noticed that the performance improves and loads at average of 234.4 ms (again from 5 attempts).
In both cases there was some random GC interference for about 100-120 ms during some of the tests.
Has anyone else observed similar behaviour when you have multiple alternative layout resources for the platform to choose from? Thanks.
After thorough testing I reached the conclusion that the more alternative layout resources you provide for a certain configuration, the longer it takes for the platform to resolve the right one at runtime.
During my tests I've seen G1 freeze when it attempts to resolve a layout from three alternatives and loads in nearly 3 seconds. On the other hand when you provide a single layout for the configuration it handles it within 500 ms.