Skip to content

Commit

Permalink
Run the benchmarks of awaiting dummy asyncs on both a Mac with M1 a…
Browse files Browse the repository at this point in the history
…nd an Ubuntu PC with AMD Ryzen™ 3900X, add more warmup and measurement iterations because the results are unstable, and rerun

The benchmark results of both show that with `runBlocking`: no dispatcher argument > `Dispatchers.Default` > `newSingleThreadContext` > `Dispatchers.IO`. The Mac with a lower Geekbench multi-core score generally outperforms the Ubuntu PC, except for the one with `Dispatchers.IO`, which is interesting.
  • Loading branch information
ShreckYe committed Nov 26, 2024
1 parent f2b15f5 commit 1bdd2cb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.huanshankeji.exposed.benchmark.coroutine

import kotlinx.benchmark.Measurement
import kotlinx.benchmark.Scope
import kotlinx.benchmark.State
import kotlinx.benchmark.Warmup

@State(Scope.Benchmark)
@Warmup(time = 1, iterations = 8)
@Measurement(time = 1, iterations = 8)
abstract class AbstractBenchmark
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.huanshankeji.exposed.benchmark.coroutine

import com.huanshankeji.exposed.benchmark.AbstractBenchmark
import com.huanshankeji.exposed.benchmark.TransactionBenchmark
import kotlinx.benchmark.Benchmark
import kotlinx.benchmark.Param
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.huanshankeji.exposed.benchmark.coroutine

import com.huanshankeji.exposed.benchmark.AbstractBenchmark
import com.huanshankeji.exposed.benchmark.TransactionBenchmark
import kotlinx.benchmark.Benchmark
import kotlinx.coroutines.runBlocking
Expand Down

0 comments on commit 1bdd2cb

Please sign in to comment.