You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this in the app I'm working on, and it seems to be an issue in the example app as well. When I add logging statements to onCreateViewHolder (for example, in the CountryNamesAdapter in the example), I can see the method being called extremely frequently. Even a very slight scrolling movement will trigger tons of calls - as if it's happening for every redraw. onBindViewHolder is called with the same frequency.
Since onCreateViewHolder is where the expensive operations (xml inflation, findViewById, etc) are supposed to live, this seems like a big performance hit.
The text was updated successfully, but these errors were encountered:
On inspection this appears to be a caching problem related to computing the position of headers partially off-screen. I imagine there will always be performance issues related to this but once the caching problem is solved the spamming of onCreateViewHolder should calm down.
I noticed this in the app I'm working on, and it seems to be an issue in the example app as well. When I add logging statements to onCreateViewHolder (for example, in the CountryNamesAdapter in the example), I can see the method being called extremely frequently. Even a very slight scrolling movement will trigger tons of calls - as if it's happening for every redraw. onBindViewHolder is called with the same frequency.
Since onCreateViewHolder is where the expensive operations (xml inflation, findViewById, etc) are supposed to live, this seems like a big performance hit.
The text was updated successfully, but these errors were encountered: