Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
ap...@google.com <ap...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit c636f8b7c7e081992813b51e7bd07e5fa47525a1
Author: jbwoods <jbwoods@google.com>
Date: Mon Feb 04 18:31:00 2019
Cache @ContentView annotation lookups for fragments
Caching the annotation look up so the reflection cost only
needs to be paid once.
This provides a performance benefit.
Test: tested with local fragment unit tests
BUG: 123709449
Change-Id: I09a2ee1268c6893ac7bb68f1f74a8bfa5cdf0f16
M fragment/src/main/java/androidx/fragment/app/Fragment.java
https://android-review.googlesource.com/895296
https://goto.google.com/android-sha1/c636f8b7c7e081992813b51e7bd07e5fa47525a1
Branch: androidx-master-dev
commit c636f8b7c7e081992813b51e7bd07e5fa47525a1
Author: jbwoods <jbwoods@google.com>
Date: Mon Feb 04 18:31:00 2019
Cache @ContentView annotation lookups for fragments
Caching the annotation look up so the reflection cost only
needs to be paid once.
This provides a performance benefit.
Test: tested with local fragment unit tests
BUG: 123709449
Change-Id: I09a2ee1268c6893ac7bb68f1f74a8bfa5cdf0f16
M fragment/src/main/java/androidx/fragment/app/Fragment.java
il...@google.com <il...@google.com> #5
This has been fixed internally and will be available in Fragment 1.1.0-alpha05
Description
Version used: 1.0.0-alpha04, 1.1.0-alpha04, respectively
As the @ContentView annotation lookup is done at runtime, it would be a performance benefit to cache the annotation lookup so that you only need to pay the reflection cost once.
This is particularly important for Fragments where onCreateView() can run multiple times (i.e., when coming back from the back stack).