Carlos
06/06/2024, 9:04 AMval players = listOf<Player>()
database.playerQueries.transaction {
players.forEach { player ->
database.playerQueries.insert(
player_number = player.number,
full_name = player.fullName
)
}
}
The sqlite.worker.js will receive a postMessage
call for each insert
, but I'm only able to receive around 5-10 inserts per second when running a transaction. I have a use case to insert around 100,000 entries of 0.5kB max each, which would take hours at this speed.
Has anyone experienced something similar or any ideas what might be going wrong? I wonder if postMessage
calls are expensive on the browser.Derek Ellis
06/06/2024, 1:28 PMDerek Ellis
06/06/2024, 1:29 PMDerek Ellis
06/06/2024, 1:30 PMCarlos
06/06/2024, 3:44 PMCarlos
06/06/2024, 3:44 PMpostMessage
async call could be accelerated, but finding ways to enhance its speed appears to be more complex.