Skip to content

Conversation

testableapple
Copy link
Contributor

@testableapple testableapple commented Oct 17, 2025

TL;DR

  • I updated swift optimization level for StreamChat to -Osize and left StreamChatUI's one as it is: -O.

Test

What Changed in Swift 6.2 (Xcode 26)

  1. More Aggressive Generic Specialization

Modern Swift compilers specialize generic code more eagerly under -O, particularly across module boundaries. This explodes binary size because every generic instantiation gets inlined and duplicated into client code.

  1. Inlining Explosion

Swift’s optimizer (SILOptimizer) became more aggressive in inlining trivial wrappers, extensions, and computed properties — especially when annotated @inlinable or @usableFromInline.

  1. Codegen Differences for ABI Stability

Swift’s stable ABI means your SDK is emitting extra symbols and metadata for resilience.
Under -O, the compiler prefers runtime speed (emitting duplicated type metadata and function bodies).
Under -Osize, it prunes these more aggressively.

@testableapple testableapple added the 🤖 CI/CD Any work related to CI/CD label Oct 17, 2025
Copy link

coderabbitai bot commented Oct 17, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/resolve-binary-size-bloat

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

1 Message
📖 Skipping Danger since the Pull Request is classed as Draft/Work In Progress

Generated by 🚫 Danger

@Stream-SDK-Bot
Copy link
Collaborator

SDK Size

title develop branch diff status
StreamChat 8.26 MB 7.54 MB -743 KB 🚀
StreamChatUI 4.89 MB 4.85 MB -49 KB 🚀

@Stream-SDK-Bot
Copy link
Collaborator

StreamChat XCSize

Object Diff (bytes)
RequestEncoder.o -158832
ChannelController.o -120137
Controller.o +102708
OfflineRequestsRepository.o -85418
ChatMessage.o -77222
Show 365 more objects
Object Diff (bytes)
MessageController.o -68037
Logger.o -65706
CDNClient.o -60378
NotificationEvents.o -54964
ChannelEvents.o -54280
Chat.o -46803
MessageDTO.o -42566
ChatClient+ChannelController.o +40273
ChannelEditDetailPayload.o -38106
MessageEditor.o -38061
SyncOperations.o -35451
MessageEvents.o -31880
ChatClient.o +29052
MessagePayloads.o -28678
MessageUpdater.o -26070
MemberController.o -22782
QueryOptions.o +22220
CurrentUserController.o -19323
ChannelListPayload.o +18162
APIClient.o +16235
MessageSearchQuery.o -16139
AttachmentQueueUploader.o -15433
ChannelUpdater.o -15244
Sequence+CompactMapLoggingError.o +13817
EndpointPath.o -12684
ChannelListController+Combine.o +11812
EventsController.o -11580
ChatChannelWatcherListController.o -11347
IdentifiablePayload.o -11156
MessagePayload+asModel.o +11104
Channel.o -10784
PollDTO.o -10749
ChannelDTO.o -10093
ErrorPayload.o -10051
ThreadEvents.o -9772
ChannelListLinker.o -9220
ReactionEvents.o -8508
PollsEvents.o -8308
UserController.o +8053
Filter+predicate.o -7910
PollController.o -7877
ConnectionController.o +7819
UserDTO.o -7285
ChannelListController.o -7237
AttachmentTypes.o +7182
ReadStateHandler.o -6970
Atomic.o +6860
ChatMessageGiphyAttachment.o +6484
MessageTranslationsPayload.o +6429
ThreadListController.o -6204
MessageRepository.o -6062
UnknownUserEvent.o +5984
MemberListController.o -5892
ChatMessageVideoAttachment.o -5666
AudioRecording.o -5424
UnknownChannelEvent.o +5340
MessageReminderListController.o -5236
MessageReminder.o -5204
ThreadQuery.o -5196
Thread.o -4716
ChatState.o -4678
PollVoteListController.o -4372
AudioAnalysing.o -4284
CurrentUserDTO.o -4269
MessageSender.o -4256
User.o +4154
CurrentUserUpdater.o -3958
PollsRepository.o -3924
PollVoteDTO.o -3830
ReactionListController.o -3792
UserUpdater.o -3730
MemberModelDTO.o -3709
ThreadListPayload.o -3650
WebSocketClient.o -3529
ChatState+Observer.o -3507
AnyAttachmentUpdater.o -3380
PollsPayloads.o -3370
ChannelListQuery.o -3358
MessageSearchController.o -3343
ChatRemoteNotificationHandler.o -3205
UserPayloads.o -3104
RemindersRepository.o -3084
AppSettings.o -3080
LivestreamChannelController+Combine.o -3050
AnyAttachmentPayload.o -3048
ChannelEventsController.o -2976
AudioPlaying.o -2963
ConnectionRepository.o +2622
ChatClient+Factory.o -2612
UserListController.o -2610
ChannelRepository.o -2610
ChatMessageAttachment.o -2584
ChannelController+Combine.o -2540
EventType.o -2408
AppStateObserving.o -2405
DatabaseContainer.o -2398
QueuedRequestDTO.o +2306
MessageSearch.o -2209
MemberEventMiddleware.o -2196
ChannelReadDTO.o -2190
MessagesPaginationStateHandling.o -2184
MessageReactionGroupDTO.o +2180
EventPayload.o -2156
MulticastDelegate.o +2076
UserSearchController.o +2049
ThreadDTO.o -1972
Poll.o -1971
MessageController+Combine.o -1900
UserEvents.o -1888
DatabaseSession.o -1856
PollController+Combine.o -1846
MemberPayload.o -1838
DraftMessagesRepository.o -1822
URLRequest+cURL.o -1817
MarkdownParser.o -1800
CurrentUserController+Combine.o -1786
ListChange.o -1760
ReminderPayloads.o -1682
LocationPayloads.o -1642
BlockedUserPayload.o -1636
ChatMessageLinkAttachment.o -1608
ChannelReadUpdaterMiddleware.o -1603
ChatMessageVoiceRecordingAttachment.o -1596
ReminderEvents.o -1576
ActiveLiveLocationsEndTimeTracker.o -1562
AudioSamplesProcessor.o +1492
ChatClientConfig.o -1491
CurrentUserController+SwiftUI.o -1484
AuthenticationRepository.o +1482
Codable+Extensions.o +1456
MessageController+SwiftUI.o -1448
PollVoteListController+SwiftUI.o -1446
DataController.o -1436
ChannelConfigDTO.o -1374
ChannelMemberListQuery.o -1368
UserController+Combine.o -1310
ConnectionRecoveryHandler.o -1308
PollVoteListController+Combine.o -1300
MemberController+Combine.o -1300
ReactionListController+Combine.o -1300
MessageReminderListQuery.o -1278
MessageReminderListController+Combine.o -1276
MessageReminderDTO.o -1272
ChatMessageImageAttachment.o -1268
UserSearchState.o -1266
ChannelController+SwiftUI.o -1254
ChannelType.o -1240
AttachmentDTO.o -1234
ChannelQuery.o -1224
PinnedMessagesQuery.o -1208
MemberListController+Combine.o -1169
ChatChannelWatcherListController+Combine.o -1169
MessageSearchController+Combine.o -1169
Pagination.o -1142
MessageState+Observer.o -1135
MessageReactionRequestPayload.o -1122
MutedChannelPayload.o -1120
SendMessageInterceptor.o -1120
ChannelListUpdater.o +1116
UserSearch.o -1092
BackgroundTaskScheduler.o -1081
TextLinkDetector.o -1080
ThreadReadDTO.o -1080
UserListState+Observer.o -1066
ReactionListState+Observer.o -1002
PushDevice.o -1000
MemberListState+Observer.o -965
ChatMessageFileAttachment.o -964
ChatMessageAudioAttachment.o -960
Array+Sampling.o +960
ChatClient+Environment.o -920
ChannelId.o -896
ChannelTruncateRequestPayload.o -894
UpdatePartialRequestBody.o -890
UserListController+Combine.o -872
CastPollVoteRequestBody.o -872
MemberEvents.o -852
TypingEventsSender.o -812
PushPreferencePayloads.o +812
RawJSON.o -792
ConnectedUser.o -782
PollVoteListQuery.o -760
PollController+SwiftUI.o -744
ChannelPayload+asModel.o -716
MessageState.o -704
DraftEvents.o -692
InternetConnection.o +684
DraftMessage.o -676
CreatePollOptionRequestBody.o -674
MessageSearchController+SwiftUI.o -672
UserChannelBanEventsMiddleware.o -657
AttachmentActionRequestBody.o -654
ChannelMemberListQueryDTO.o -652
CreatePollRequestBody.o -649
PinnedMessagesPagination.o -648
ChatChannelWatcherListController+SwiftUI.o -644
ChannelListController+SwiftUI.o -644
MemberListController+SwiftUI.o -644
ChannelListState.o -640
UserListQuery.o -636
Device.o +616
ChannelListSortingKey.o -616
AudioAnalysisEngine.o -613
UserListSortingKey.o -608
ChannelList.o -607
NSManagedObject+Extensions.o -602
TypingEvent.o -596
MessageSearchState.o -588
Filter.o -587
CurrentUserPayloads.o -582
ChannelMemberListSortingKey.o -576
EventNotificationCenter.o -560
ThreadUpdaterMiddleware.o -556
FlagRequestBody.o -536
Member.o -536
MultipartFormData.o +524
ReactionListController+SwiftUI.o -520
UserListController+SwiftUI.o -520
CountdownTracker.o -504
MessageEndpoints.o -502
UserController+SwiftUI.o -492
UserWatchingEventMiddleware.o -488
SharedLocationDTO.o -488
MemberController+SwiftUI.o -476
ChannelListState+Observer.o -472
ConnectionStatus.o -468
TypingStartCleanupMiddleware.o -458
Endpoint.o -456
NSManagedObject+Validation.o +451
ThreadsRepository.o -450
StreamCollection.o -446
AttachmentId.o -432
CurrentUser.o -432
ThreadParticipantDTO.o -416
ThreadListController+SwiftUI.o -401
AudioSessionConfiguring.o -397
SharedLocation.o -396
LazyCachedMapCollection.o +392
EventBatcher.o +388
KeyedDecodingContainer+Array.o -384
URLSessionWebSocketEngine.o +382
UnreadMessageLookup.o -380
CommandDTO.o +379
GuestUserTokenRequestPayload.o -378
UploadedAttachment.o -376
Bundle+Extensions.o +374
MessageModerationDetailsPayload.o -359
WebSocketConnectPayload.o +352
BaseLogDestination.o -352
ConnectionController+Combine.o -348
ChannelCodingKeys.o -346
MessageReactionType.o -344
AssetPropertyLoading.o -344
RetryStrategy.o -340
AppSettingsPayload.o -326
ClientError.o +324
AudioValuePercentageNormaliser.o +324
MessageSearchState+Observer.o -322
GuestUserTokenPayload.o -314
AVAsset+TotalAudioSamples.o -312
FileUploadPayload.o -310
MessageReactionPayload.o -308
AttachmentDownloader.o +306
ConnectionEvents.o -296
ThreadListQuery.o -288
AudioQueuePlayer.o -284
ReminderUpdaterMiddleware.o -284
AudioPlaybackContext.o -280
PollVoteListQueryDTO.o -276
ChannelVisibilityEventMiddleware.o -276
AudioSamplesExtractor.o +272
WebSocketPingController.o +271
MessageReaction.o -268
HTTPHeader.o -268
AudioRecordingContext.o -268
DraftPayloads.o +264
ManualEventHandler.o +262
FlagUserPayload.o -256
ThreadEndpoints.o -256
ChannelMemberUnbanRequestPayload.o -250
AudioSessionProtocol.o +248
SyncRepository.o -248
ConnectionController+SwiftUI.o -244
TranslationLanguage.o -240
ChannelMemberUpdater.o +240
FlagMessagePayload.o -234
MemberEndpoints.o -234
MessagePinning.o -228
MessageAttachmentPayload.o -222
UserList.o -222
AttachmentUploader.o -220
IdentifiableModel.o +208
MissingEventsRequestBody.o -202
MemberUpdatePayload.o -198
Deprecations.o -196
BaseURL.o -196
ChannelTruncatedEventMiddleware.o -196
MuteDetails.o -196
PollVote.o -192
UserListPayload.o +190
UnreadCount.o -184
PollOptionDTO.o +183
AsyncOperation.o +180
EventDecoder.o -180
ChannelListQueryDTO.o -180
ChannelMemberListPayload.o +178
UserListState.o +176
ChatClientFactory.o +176
UserListQueryDTO.o +168
AudioPlayerObserving.o +165
ScheduledStreamTimer.o -160
ChannelMemberBanRequestPayload.o -156
MessageReactionGroupPayload.o +154
PinnedMessagesSortingKey.o -152
LogDestination.o +152
EventsController+SwiftUI.o -146
EventsController+Combine.o +144
ChannelEndpoints.o -142
CustomEventRequestBody.o -142
DeviceDTO.o -136
MissingEventsPayload.o +136
AudioPlaybackState.o -132
DraftListQuery.o +130
ConnectedUserState.o -128
AudioRecordingContextAccessor.o +126
Token.o -119
MemberListState.o -119
DevicePayloads.o +116
Sorting.o +116
ChannelArchivingScope.o +108
BackgroundEntityDatabaseObserver.o +103
ChannelMemberListUpdater.o -102
MessageReactionGroup.o -100
ThreadRead.o -96
PushPreference.o -96
MessageSearchQueryDTO.o -92
NewLocationInfo.o -92
ReactionListState.o -89
ReactionListQuery.o -88
MessageReactionDTO.o +88
PushPreferenceDTO.o -88
UserTypingStateUpdaterMiddleware.o -88
OptionalDecodable.o -84
UserInfo.o +84
ReactionListUpdater.o -82
EntityChange.o -72
DraftUpdaterMiddleware.o -68
AudioPlaybackContextAccessor.o +68
Error+InternetNotAvailable.o -68
ReactionListQueryDTO.o +68
AudioRecordingState.o +68
ThreadParticipant.o -64
ReactionList.o +64
ChannelMuteDTO.o +57
StringInterpolation+Extensions.o -56
EventDataProcessorMiddleware.o -52
ChatClient+ReactionListController.o -52
ConnectedUserState+Observer.o +48
MessageModerationDetailsDTO.o +48
Timers.o +48
BlockedUserDetails.o -46
Throttler.o -46
LivestreamChannelController.o +44
Reachability_Vendor.o +44
ChannelRead.o -44

@Stream-SDK-Bot
Copy link
Collaborator

StreamChatUI XCSize

Object Diff (bytes)
Appearance+Images.o -35905
ContainerStackView.o +25506
ChatMessageReactionAuthorsFlowLayout.o -20353
AppearanceProvider.o +16960
ComponentsProvider.o +14356
Show 171 more objects
Object Diff (bytes)
SwipeToReplyGestureHandler.o -10920
ChatMessageContentView.o -8055
ChatMessageListView.o +7161
AttachmentsPreviewVC.o -7136
ChatThreadListVC.o -5266
ChatMessageListVC.o -4816
TaskLoadImage.o -4416
UnsupportedAttachmentViewInjector.o -4044
ChatChannelVC.o -3808
ImagePipeline.o +3652
ChatMessageGiphyView.o +3285
ImageCache.o -2620
UIImageView+SwiftyGif.o -2576
ChatMessageSearchVC.o +2402
MarkdownFormatter.o +2256
ViewContainerBuilder.o -2200
MessageActionsTransitionController.o -2016
ImageProcessing.o +1918
UITextView+Extensions.o +1759
ChatMessageGalleryView.o -1628
ComposerVC.o -1568
ChatMessage+Extensions.o -1444
ChatChannelAvatarView.o -1404
ChatMessageLayoutOptionsResolver.o -1260
UploadingOverlayView.o -1244
ChatMessageActionsVC.o +1200
ResumableData.o +1156
DataLoader.o -1091
ChatMessageReactionsPickerVC.o -1076
InputTextView.o -1048
ImageResultsMapper.o +948
TaskFetchOriginalImageData.o +932
ChatSuggestionsVC.o -912
ChatMessageListView+DiffKit.o -907
WaveformView.o +892
NukeImageLoader.o +888
ImagePipelineCache.o +880
ChatMessagePopupVC.o -860
GalleryVC.o +825
ImagePublisher.o +810
ChatMessageReactionsView.o +786
DifferenceKit+Stream.o -785
TextViewMentionedUsersHandler.o +772
Changeset.o -770
ChatThreadListItemView.o +728
VideoPlaybackControlView.o -716
PollResultsVC.o -640
StagedChangeset.o -630
StreamCDN.o -624
StackedUserAvatarsView.o -596
ChatThreadVC.o -576
Task.o -568
TaskFetchDecodedImage.o -537
Deprecations.o -512
ChatChannelNamer.o -492
PollCommentListSectionFooterView.o +472
ChatMessageReactionAuthorsVC.o -456
ChatChannelListItemView.o -444
QuotedChatMessageView.o -436
DataCache.o -432
ChatMessageCell.o +424
ChatMessageLayoutOptions.o -416
ImageViewExtensions.o -398
UIImage+SwiftyGif.o -388
VideoAttachmentGalleryCell.o -384
PollAttachmentOptionListItemView.o +380
ClampedView.o -376
ChatMessageListRouter.o -370
PollCreationVC.o -368
AudioQueuePlayerNextItemProvider.o -356
PollAttachmentView.o +356
BaseViews.o +352
Algorithm.o -316
ListCollectionViewLayout.o -312
NukeImageProcessor.o +305
MixedAttachmentViewInjector.o -296
ChatMessageHeaderDecoratorView.o +296
PollResultsTableHeaderView.o +292
PollResultsSectionHeaderView.o +288
ChatMessageLinkPreviewView.o -288
ImageRequestKeys.o -282
InputChatMessageView.o +280
ComposerKeyboardHandler.o +276
ImageResponse.o -272
DateUtils.o -272
LiveRecordingView.o -268
VideoAttachmentGalleryPreview.o +268
ChatMessageVoiceRecordingAttachmentListView+ItemView.o +264
PollResultsSectionFooterView.o +260
ImagePipelineConfiguration.o -260
ChatChannelHeaderView.o -256
ChatMessageInteractiveAttachmentView.o -256
PollResultsVoteListVC.o -248
PollCreationFeatureCell.o +232
PollCreationMultipleVotesFeatureCell.o +211
PollCreationNameCell.o +204
ChatFileAttachmentListView+ItemView.o +204
BannerView.o +192
PollCommentListVC.o -188
GradientView.o -184
PollAttachmentOptionListView.o +184
SwiftyGifManager.o +178
String+Extensions.o -176
ChatMessageReactionAuthorViewCell.o +176
ImagePrefetcher.o -162
UIViewController+Extensions.o +156
ComposerView.o +156
VoiceRecordingVC.o -152
ImageDecoding.o -152
PlayPauseButton.o +152
ImagePipelineTask.o -144
Appearance+ColorPalette.o -144
GalleryAttachmentViewInjector.o +133
TypingIndicatorView.o +132
TaskLoadData.o +128
GiphyAttachmentViewInjector.o +128
CommandLabelView.o +124
ChatMentionSuggestionView.o +124
PollCommentListSectionHeaderView.o +124
AttachmentViewCatalog.o -120
ChatChannelListLoadingViewCellContentView.o -120
RecordButton.o +120
AttachmentPreviewProvider.o +116
ZoomTransitionController.o +116
ChatChannelListSearchVC.o -116
PollCreationOptionCell.o +112
UIView+Extensions.o +108
ChatReactionPickerBubbleView.o -104
InvertedScrollViewPaginationHandler.o +104
VideoAttachmentComposerPreview.o -100
AlertsRouter.o +100
PollAttachmentViewInjector.o +100
FetchImage.o +100
ChatChannelListRouter.o -96
StatefulScrollViewPaginationHandler.o -96
MediaButton.o -92
CurrentChatUserAvatarView.o -92
CheckboxControl.o +88
ChatMessageActionControl.o +84
AudioVisualizationView.o -84
StreamChat.tbd +84
ChatUserAvatarView.o -80
ChatUnreadMessagesCountDecorationView.o -76
ZoomDismissalInteractionController.o +76
ChatMessageAttachmentPreviewVC.o -76
ChannelListSearchStrategy.o +76
ChatMessageInteractiveAttachmentView+ActionButton.o -72
ChatChannelListVC.o -72
JumpToUnreadMessagesButton.o -72
ChatThreadListRouter.o -72
ImageMerger.o -72
ImageEncoding.o -68
ChatMessageImageGallery+ImagePreview.o +68
Calendar+StreamCalendar.o +64
ChatChannelSearchVC.o -64
SwipeableView.o +64
ChatAvatarView.o +60
ChatMessageGiphyView+GiphyBadge.o +56
ChatReactionsBubbleView.o -56
StreamModalTransitioningDelegate.o -52
ImageAttachmentComposerPreview.o -52
ChatMessageVoiceRecordingAttachmentListView.o -52
ZoomAnimator.o +52
ChatMessageFileAttachmentListView.o -50
TextFieldView.o +48
PollCreationTextFieldView.o +48
ImageLoaderOptions.o +48
ChatChannelListVC+SwiftUI.o +48
FileAttachmentViewInjector.o -44
ScrollViewPaginationHandler.o -44
AttachmentActionButton.o -44

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 CI/CD Any work related to CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants