From 50837c3d06887cf081ece1b20642008706e7b21a Mon Sep 17 00:00:00 2001 From: Flavio Brasil Date: Thu, 7 Sep 2023 22:03:14 -0700 Subject: [PATCH] remove ox benchs for now --- build.sbt | 4 +-- .../scala/kyo/bench/BroadFlatMapBench.scala | 24 ++++++------- .../scala/kyo/bench/ChainedForkBench.scala | 30 ++++++++-------- .../main/scala/kyo/bench/ForkManyBench.scala | 36 +++++++++---------- .../kyo/bench/ProducerConsumerBench.scala | 36 +++++++++---------- 5 files changed, 65 insertions(+), 65 deletions(-) diff --git a/build.sbt b/build.sbt index 09f22d877..40e326fc7 100644 --- a/build.sbt +++ b/build.sbt @@ -225,8 +225,8 @@ lazy val `kyo-bench` = `without-cross-scala`, libraryDependencies += "org.typelevel" %% "cats-effect" % "3.5.1", libraryDependencies += "dev.zio" %% "zio" % zioVersion, - libraryDependencies += "dev.zio" %% "zio-concurrent" % zioVersion, - libraryDependencies += "com.softwaremill.ox" %% "core" % "0.0.12" + libraryDependencies += "dev.zio" %% "zio-concurrent" % zioVersion + // libraryDependencies += "com.softwaremill.ox" %% "core" % "0.0.12" ) lazy val `js-settings` = Seq( diff --git a/kyo-bench/src/main/scala/kyo/bench/BroadFlatMapBench.scala b/kyo-bench/src/main/scala/kyo/bench/BroadFlatMapBench.scala index 41d53fa91..2c03d36bb 100644 --- a/kyo-bench/src/main/scala/kyo/bench/BroadFlatMapBench.scala +++ b/kyo-bench/src/main/scala/kyo/bench/BroadFlatMapBench.scala @@ -40,20 +40,20 @@ class BroadFlatMapBench extends Bench.SyncAndFork[BigInt] { zioFib(depth) } - def oxFib(n: Int): BigInt = - if (n <= 1) n - else oxFib(n - 1) + oxFib(n - 2) + // def oxFib(n: Int): BigInt = + // if (n <= 1) n + // else oxFib(n - 1) + oxFib(n - 2) // @Benchmark - def syncOx(): BigInt = { - oxFib(depth) - } + // def syncOx(): BigInt = { + // oxFib(depth) + // } // @Benchmark - def forkOx(): BigInt = { - import ox._ - scoped { - fork(oxFib(depth)).join() - } - } + // def forkOx(): BigInt = { + // import ox._ + // scoped { + // fork(oxFib(depth)).join() + // } + // } } diff --git a/kyo-bench/src/main/scala/kyo/bench/ChainedForkBench.scala b/kyo-bench/src/main/scala/kyo/bench/ChainedForkBench.scala index 929f5ad08..aeb572e6b 100644 --- a/kyo-bench/src/main/scala/kyo/bench/ChainedForkBench.scala +++ b/kyo-bench/src/main/scala/kyo/bench/ChainedForkBench.scala @@ -76,19 +76,19 @@ class ChainedForkBench extends Bench.ForkOnly[Int] { } // @Benchmark - def forkOx() = { - import ox._ - def iterate(p: CompletableFuture[Unit], n: Int): Unit = - if (n <= 0) p.complete(()) - else - scoped { - fork(iterate(p, n - 1)) - } - - scoped { - val p = new CompletableFuture[Unit]() - fork(iterate(p, depth)) - p.get() - } - } + // def forkOx() = { + // import ox._ + // def iterate(p: CompletableFuture[Unit], n: Int): Unit = + // if (n <= 0) p.complete(()) + // else + // scoped { + // fork(iterate(p, n - 1)) + // } + + // scoped { + // val p = new CompletableFuture[Unit]() + // fork(iterate(p, depth)) + // p.get() + // } + // } } diff --git a/kyo-bench/src/main/scala/kyo/bench/ForkManyBench.scala b/kyo-bench/src/main/scala/kyo/bench/ForkManyBench.scala index 561da3cd4..1b4509e14 100644 --- a/kyo-bench/src/main/scala/kyo/bench/ForkManyBench.scala +++ b/kyo-bench/src/main/scala/kyo/bench/ForkManyBench.scala @@ -79,22 +79,22 @@ class ForkManyBench extends Bench.ForkOnly[Int] { } // @Benchmark - def forkOx() = { - import ox._ - import ox.channels._ - - scoped { - val promise = new CompletableFuture[Unit] - val ref = new AtomicInteger(depth) - for (_ <- 0 until depth) { - fork { - ref.decrementAndGet() match { - case 1 => promise.complete(()) - case _ => () - } - } - } - promise.get() - } - } + // def forkOx() = { + // import ox._ + // import ox.channels._ + + // scoped { + // val promise = new CompletableFuture[Unit] + // val ref = new AtomicInteger(depth) + // for (_ <- 0 until depth) { + // fork { + // ref.decrementAndGet() match { + // case 1 => promise.complete(()) + // case _ => () + // } + // } + // } + // promise.get() + // } + // } } diff --git a/kyo-bench/src/main/scala/kyo/bench/ProducerConsumerBench.scala b/kyo-bench/src/main/scala/kyo/bench/ProducerConsumerBench.scala index 4d12493d1..90a10466d 100644 --- a/kyo-bench/src/main/scala/kyo/bench/ProducerConsumerBench.scala +++ b/kyo-bench/src/main/scala/kyo/bench/ProducerConsumerBench.scala @@ -72,22 +72,22 @@ class ProducerConsumerBench extends Bench.ForkOnly[Unit] { } // @Benchmark - def forkOx() = { - import ox._ - import ox.channels._ - - val q = Channel[Unit](depth / 2) - scoped { - val f1 = - fork { - for (_ <- 0 until depth) q.send(()).orThrow - } - val f2 = - fork { - for (_ <- 0 until depth) q.take(1).drain() - } - f1.join() - f2.join() - } - } + // def forkOx() = { + // import ox._ + // import ox.channels._ + + // val q = Channel[Unit](depth / 2) + // scoped { + // val f1 = + // fork { + // for (_ <- 0 until depth) q.send(()).orThrow + // } + // val f2 = + // fork { + // for (_ <- 0 until depth) q.take(1).drain() + // } + // f1.join() + // f2.join() + // } + // } }