christophsturm
11/20/2020, 3:46 PM(0 until entries).map {
async {
repo.create(connection, user)
}
}.forEach { it.await() }
thevery
11/20/2020, 3:54 PMdelay
?christophsturm
11/20/2020, 4:00 PMthevery
11/20/2020, 4:47 PMChantry Cargill
11/23/2020, 9:59 AMchristophsturm
11/23/2020, 10:05 AMChantry Cargill
11/23/2020, 10:54 AMchristophsturm
11/23/2020, 11:18 AMtest("bulk inserts") {
val channel = Channel<Deferred<User>>(capacity = 40)
val entries = 1000
launch {
connection.transaction {
repeat(entries) {
channel.send(async {
repo.create(connection, user)
})
}
}
}
repeat(entries) { channel.receive().await() }
}
Chantry Cargill
11/23/2020, 11:30 AMsomeList.chunked(maxSize).flatMap { it.map { async { repo.create(connection, user) } }.awaitAll() }
christophsturm
11/23/2020, 12:29 PMChantry Cargill
11/23/2020, 12:40 PM