Skip to content

Commit

Permalink
Add trace around the onViewRecycledInternal method
Browse files Browse the repository at this point in the history
Summary: Adding a trace block around when a View is recycled by the `RecyclerBinder`. This would have been helpful on an investigation I was doing yesterday.

Reviewed By: adityasharat

Differential Revision: D58730446

fbshipit-source-id: b1bf8687478cef14c742bb98d0112fcb5ef54195
  • Loading branch information
Fabio Carballo authored and facebook-github-bot committed Jun 19, 2024
1 parent 0b021c1 commit 3a0db56
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4020,6 +4020,10 @@ public void run() {
}

private void onViewRecycledInternal(RecyclerBinderViewHolder holder) {
boolean isTracing = ComponentsSystrace.isTracing();
if (isTracing) {
ComponentsSystrace.beginSection("RecyclerBinder.InternalAdapter#onViewRecycledInternal");
}
final LithoView lithoView = (LithoView) holder.getLithoView();
if (lithoView != null) {
mRecyclerBinderAdapterDelegate.onViewRecycled(holder);
Expand All @@ -4035,6 +4039,10 @@ private void onViewRecycledInternal(RecyclerBinderViewHolder holder) {
}
}
}

if (isTracing) {
ComponentsSystrace.endSection();
}
}

private void executePostponedViewRecycle(BaseViewHolder viewHolder) {
Expand Down

0 comments on commit 3a0db56

Please sign in to comment.