Skip to content

perf: optimize recycling item type resolution#3697

Merged
isekovanic merged 4 commits into
developfrom
perf/optimize-get-item-type
Jul 2, 2026
Merged

perf: optimize recycling item type resolution#3697
isekovanic merged 4 commits into
developfrom
perf/optimize-get-item-type

Conversation

@isekovanic

Copy link
Copy Markdown
Contributor

🎯 Goal

This PR is a followup to this change.

In addition to making sure React doesn't remount components while recycling, we also have to make sure to try resolving components in the recycling pool as fast as possible.

For instance, if all messages with attachments belong to the same pool we can get into a situation where we try to recycle something like a voice recording into a gallery. This, needless to say is going to be super suboptiomal. Possibly worse than having no item type at all (since voice recording as an example has so many subcomponents it would take some serious effort to clean them up from the GC side as well as all of the Fabric nodes).

With this change we try to improve that by making the recycling pool (especially for attachments) way more explicit.

🛠 Implementation details

🎨 UI Changes

iOS
Before After
Android
Before After

🧪 Testing

☑️ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

@isekovanic isekovanic requested review from oliverlaz and szuperaz July 2, 2026 14:51
@Stream-SDK-Bot

Copy link
Copy Markdown
Contributor

SDK Size

title develop branch diff status
js_bundle_size 1974 KB 1975 KB +690 B 🔴

@isekovanic isekovanic merged commit bcbf406 into develop Jul 2, 2026
7 of 8 checks passed
@isekovanic isekovanic deleted the perf/optimize-get-item-type branch July 2, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants