Skip to main content

Baseline benchmark

benchmark38 ran on SDK 261c21c95f1e82de2e44c47d8f0473d9cdd4e4a0, before item quotes, inside the AndroidPerformanceAuditTest of 665acfc1, with its seedReplies() less the quote check. It is kept here and not in the suite, since on the current SDK the item page already reads the quotes.

/**
* A page of 50 replies and the 10 messages they quote, read as clients did before quotes came
* with the page: the item page, then its quotes. Measured on the SDK before quotes, since here
* the item page already reads them.
*/
@Test
fun benchmark38SdkAccountReplyItemsThenQuotes50() = measure {
runBlocking {
val page = sdkAccount.messages.conversationItems(conversationId = replyConversationId, limit = 50).items
.mapNotNull { (it as? ConversationItem.MessageItem)?.message }
val quoted = sdkAccount.messages.getMany(page.mapNotNull { it.relatedMessageId }.distinct())
page.sumOf { it.content.text.length } + quoted.sumOf { it.content.text.length }
}
}