william
02/25/2021, 2:05 AMmessageDao.transaction {
newMessages
.map { it.toDbMessage(groupId) }
.forEach(messageDao::insertOrIgnore)
}
and with about 1000 messages its taking 200-300 ms (on an emulator). i imagine a real device might be slightly faster but not an order of magnitude faster. Is there anything else I can do to speed this up?
table details in threadwilliam
02/25/2021, 2:06 AMCREATE TABLE Message (
groupId INTEGER NOT NULL,
messageId INTEGER NOT NULL,
sender TEXT NOT NULL,
message TEXT NOT NULL,
timestamp TEXT NOT NULL,
PRIMARY KEY (groupId, messageId)
);
`insertOrIgnore`:
insertOrIgnore:
INSERT OR IGNORE INTO Message
VALUES ?;
leandro
02/25/2021, 12:30 PM