From 61af148713e15e10b3829877f5448d53f5700ff2 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Thu, 25 May 2023 15:33:14 +0200 Subject: [PATCH 01/10] start js benchmark with dummy example --- benchmark/README.md | 9 +++++ benchmark/index.html | 12 ++++++ .../diesel/benchmark/DieselBenchmark.scala | 38 +++++++++++++++++++ .../main/scala/diesel/benchmark/Main.scala | 28 ++++++++++++++ build.sbt | 32 +++++++++++++++- project/plugins.sbt | 1 + 6 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 benchmark/README.md create mode 100644 benchmark/index.html create mode 100644 benchmark/js/src/main/scala/diesel/benchmark/DieselBenchmark.scala create mode 100644 benchmark/js/src/main/scala/diesel/benchmark/Main.scala diff --git a/benchmark/README.md b/benchmark/README.md new file mode 100644 index 0000000..0ca3a42 --- /dev/null +++ b/benchmark/README.md @@ -0,0 +1,9 @@ +# Benchmarking and Profiling + +## TODO +- Scala JS +- JVM + +## Links +- https://github.com/japgolly/scalajs-benchmark +- https://github.com/sbt/sbt-jmh \ No newline at end of file diff --git a/benchmark/index.html b/benchmark/index.html new file mode 100644 index 0000000..c14717f --- /dev/null +++ b/benchmark/index.html @@ -0,0 +1,12 @@ + + + + scalajs-benchmarks + + +
Loading...
+ + + + + \ No newline at end of file diff --git a/benchmark/js/src/main/scala/diesel/benchmark/DieselBenchmark.scala b/benchmark/js/src/main/scala/diesel/benchmark/DieselBenchmark.scala new file mode 100644 index 0000000..42baaab --- /dev/null +++ b/benchmark/js/src/main/scala/diesel/benchmark/DieselBenchmark.scala @@ -0,0 +1,38 @@ +/* + * Copyright 2018 The Diesel Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package diesel.benchmark + +import japgolly.scalajs.benchmark._ +import japgolly.scalajs.benchmark.gui._ + +object DieselBenchmark { + val suite = GuiSuite( + Suite("Example Benchmarks")( + // Benchmark #1 + Benchmark("foreach") { + var s = Set.empty[Int] + (1 to 100) foreach (s += _) + s + }, + + // Benchmark #2 + Benchmark("fold") { + (1 to 100).foldLeft(Set.empty[Int])(_ + _) + } + ) + ) +} diff --git a/benchmark/js/src/main/scala/diesel/benchmark/Main.scala b/benchmark/js/src/main/scala/diesel/benchmark/Main.scala new file mode 100644 index 0000000..8f66ecb --- /dev/null +++ b/benchmark/js/src/main/scala/diesel/benchmark/Main.scala @@ -0,0 +1,28 @@ +/* + * Copyright 2018 The Diesel Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package diesel.benchmark + +import org.scalajs.dom.document +import japgolly.scalajs.benchmark.gui.BenchmarkGUI + +object Main { + + def main(args: Array[String]) = { + val body = document getElementById "body" + BenchmarkGUI.renderSuite(body)(DieselBenchmark.suite) + } +} diff --git a/build.sbt b/build.sbt index 85f2b6a..004b484 100644 --- a/build.sbt +++ b/build.sbt @@ -44,7 +44,15 @@ addCommandAlias("testJS", "all dieselJS/test samplesJS/test") lazy val root = project .in(file(".")) - .aggregate(diesel.jvm, diesel.js, samples.jvm, samples.js, samplesBundle) + .aggregate( + diesel.jvm, + diesel.js, + samples.jvm, + samples.js, + samplesBundle, + benchmark.jvm, + benchmark.js + ) .settings(commonSettings) .settings(sonatypeSettings) .settings(copyrightSettings) @@ -142,3 +150,25 @@ lazy val samplesBundle = project .settings(commonSettings) .settings(copyrightSettings) .dependsOn(samples.js) + +lazy val benchmark = crossProject(JSPlatform, JVMPlatform) + .withoutSuffixFor(JVMPlatform) + .settings(commonSettings) + .settings(copyrightSettings) + .settings( + name := "diesel-core-benchmark", + publish / skip := true + ) + .settings(sharedSettings_scalac) + .settings(sharedSettings_lint) +// .jsSettings(sharedJsSettings) + .enablePlugins(JSDependenciesPlugin) + .jsSettings( + libraryDependencies ++= Seq( + "com.github.japgolly.scalajs-benchmark" %%% "benchmark" % "0.10.0", + "org.scala-js" %%% "scalajs-dom" % "2.5.0" + ), + scalaJSUseMainModuleInitializer := true, + scalaJSLinkerConfig ~= { _.withSourceMap(true) }, + packageJSDependencies / skip := false + ) diff --git a/project/plugins.sbt b/project/plugins.sbt index db7a159..60a6dcf 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,6 @@ addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.1") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.1") +addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.9.0") From ab0a4b4500f25da6e8913501d53dea62254d083d Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Thu, 25 May 2023 16:26:06 +0200 Subject: [PATCH 02/10] use diesel samples for benchmark cases --- .../diesel/benchmark/DieselBenchmark.scala | 17 +-- .../diesel/benchmark/BenchmarkCases.scala | 127 ++++++++++++++++++ build.sbt | 1 + 3 files changed, 135 insertions(+), 10 deletions(-) create mode 100644 benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala diff --git a/benchmark/js/src/main/scala/diesel/benchmark/DieselBenchmark.scala b/benchmark/js/src/main/scala/diesel/benchmark/DieselBenchmark.scala index 42baaab..e9b0d55 100644 --- a/benchmark/js/src/main/scala/diesel/benchmark/DieselBenchmark.scala +++ b/benchmark/js/src/main/scala/diesel/benchmark/DieselBenchmark.scala @@ -19,19 +19,16 @@ package diesel.benchmark import japgolly.scalajs.benchmark._ import japgolly.scalajs.benchmark.gui._ +import BenchmarkCases._ + object DieselBenchmark { val suite = GuiSuite( - Suite("Example Benchmarks")( - // Benchmark #1 - Benchmark("foreach") { - var s = Set.empty[Int] - (1 to 100) foreach (s += _) - s + Suite("Diesel Benchmarks")( + Benchmark("Simple BMD") { + parseSimpleBmd }, - - // Benchmark #2 - Benchmark("fold") { - (1 to 100).foldLeft(Set.empty[Int])(_ + _) + Benchmark("Some Glsl") { + parseSomeGlsl } ) ) diff --git a/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala b/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala new file mode 100644 index 0000000..84b24f9 --- /dev/null +++ b/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala @@ -0,0 +1,127 @@ +package diesel.benchmark + +import diesel.samples.glsl.Glsl +import diesel.samples.jsmodeldsl.BmdDsl +import diesel.{AstHelpers, Dsl} + +object BenchmarkCases { + + def parseSimpleBmd: Unit = { + val text = + """|start with a Foo. + |a Foo is a concept. + |a Gnu is a xx. + |""".stripMargin + parseSome(BmdDsl, Some(BmdDsl.aCompileUnit))(text) + } + + def parseSomeGlsl: Unit = { + val text = + """void mainImage( out vec4 fragColor, in vec2 fragCoord ) + |{ + | vec2 uv = fragCoord/iResolution.xy; + | + | if (true) { + | return 12; + | } + | + | vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4)); + | + | fragColor = vec4(col,1.0); + |} + |void mainImage( out vec4 fragColor, in vec2 fragCoord ) + |{ + | vec2 uv = fragCoord/iResolution.xy; + | + | if (true) { + | return 12; + | } + | + | vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4)); + | + | fragColor = vec4(col,1.0); + |} + |void mainImage( out vec4 fragColor, in vec2 fragCoord ) + |{ + | vec2 uv = fragCoord/iResolution.xy; + | + | if (true) { + | return 12; + | } + | + | vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4)); + | + | fragColor = vec4(col,1.0); + |} + |void mainImage( out vec4 fragColor, in vec2 fragCoord ) + |{ + | vec2 uv = fragCoord/iResolution.xy; + | + | if (true) { + | return 12; + | } + | + | vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4)); + | + | fragColor = vec4(col,1.0); + |} + |void mainImage( out vec4 fragColor, in vec2 fragCoord ) + |{ + | vec2 uv = fragCoord/iResolution.xy; + | + | if (true) { + | return 12; + | } + | + | vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4)); + | + | fragColor = vec4(col,1.0); + |} + |void mainImage( out vec4 fragColor, in vec2 fragCoord ) + |{ + | vec2 uv = fragCoord/iResolution.xy; + | + | if (true) { + | return 12; + | } + | + | vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4)); + | + | fragColor = vec4(col,1.0); + |} + | + |float x = 12; + | + |void mainImage( out vec4 fragColor, in vec2 fragCoord ) + |{ + | vec2 uv = fragCoord/iResolution.xy; + | + | if (true) { + | return 12; + | } + | + | vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4)); + | + | fragColor = vec4(col,1.0); + |} + | + |void mainImage( out vec4 fragColor, in vec2 fragCoord ) + |{ + | vec2 uv = fragCoord/iResolution.xy; + | + | if (true) { + | return 12; + | } + | + | vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4)); + | + | fragColor = vec4(col,1.0); + |} + |""".stripMargin + parseSome(Glsl, Some(Glsl.a))(text) + } + + private def parseSome(dsl: Dsl, axiom: Option[Dsl.Axiom[_]] = None)(text: String): Unit = { + AstHelpers.parse(dsl, text, axiom) + } +} diff --git a/build.sbt b/build.sbt index 004b484..90512c3 100644 --- a/build.sbt +++ b/build.sbt @@ -172,3 +172,4 @@ lazy val benchmark = crossProject(JSPlatform, JVMPlatform) scalaJSLinkerConfig ~= { _.withSourceMap(true) }, packageJSDependencies / skip := false ) + .dependsOn(samples) From be593717d99f85794987d6339d3f14a69421f145 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Thu, 25 May 2023 17:01:33 +0200 Subject: [PATCH 03/10] use JMH for jvm benchmarkings --- .../diesel/benchmark/DieselBenchmark.scala | 33 +++++++++++++++++++ build.sbt | 3 +- project/plugins.sbt | 1 + 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 benchmark/jvm/src/main/scala/diesel/benchmark/DieselBenchmark.scala diff --git a/benchmark/jvm/src/main/scala/diesel/benchmark/DieselBenchmark.scala b/benchmark/jvm/src/main/scala/diesel/benchmark/DieselBenchmark.scala new file mode 100644 index 0000000..35abe6a --- /dev/null +++ b/benchmark/jvm/src/main/scala/diesel/benchmark/DieselBenchmark.scala @@ -0,0 +1,33 @@ +/* + * Copyright 2018 The Diesel Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package diesel.benchmark + +import diesel.benchmark.BenchmarkCases._ +import org.openjdk.jmh.annotations.Benchmark + +class DieselBenchmark { + @Benchmark + def simpleBMD(): Unit = { + parseSimpleBmd + } + + @Benchmark + def someGlsl(): Unit = { + parseSomeGlsl + } + +} diff --git a/build.sbt b/build.sbt index 90512c3..ad7162c 100644 --- a/build.sbt +++ b/build.sbt @@ -161,8 +161,7 @@ lazy val benchmark = crossProject(JSPlatform, JVMPlatform) ) .settings(sharedSettings_scalac) .settings(sharedSettings_lint) -// .jsSettings(sharedJsSettings) - .enablePlugins(JSDependenciesPlugin) + .enablePlugins(JSDependenciesPlugin, JmhPlugin) .jsSettings( libraryDependencies ++= Seq( "com.github.japgolly.scalajs-benchmark" %%% "benchmark" % "0.10.0", diff --git a/project/plugins.sbt b/project/plugins.sbt index 60a6dcf..903ef35 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,6 +5,7 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.9.0") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.4") addSbtPlugin( "com.ibm.cloud.diesel" % "diesel-i18n-plugin" % "0.6.0" From 0ce20b9d15447b52f18ae16fc3e2dc373ec5b6ad Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Thu, 25 May 2023 17:01:59 +0200 Subject: [PATCH 04/10] add main for profiling from within IntelliJ --- .../src/main/scala/diesel/benchmark/BenchmarkCases.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala b/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala index 84b24f9..ff06370 100644 --- a/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala +++ b/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala @@ -124,4 +124,10 @@ object BenchmarkCases { private def parseSome(dsl: Dsl, axiom: Option[Dsl.Axiom[_]] = None)(text: String): Unit = { AstHelpers.parse(dsl, text, axiom) } + + // use main with IntelliJ profiler + def main(args: Array[String]): Unit = { + parseSimpleBmd + parseSimpleBmd + } } From 9fc429011043cec2d061ab93d78420a726de42e8 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Thu, 25 May 2023 17:02:14 +0200 Subject: [PATCH 05/10] add hints --- benchmark/README.md | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/benchmark/README.md b/benchmark/README.md index 0ca3a42..ccb2d2c 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -1,8 +1,37 @@ # Benchmarking and Profiling -## TODO -- Scala JS -- JVM +## Scala JS + +Open in [index.html](./index.html) a browser. + +Use devtool profiling ... + +## Scala JVM + +Run from `sbt` using +``` +benchmark/jmh:run -i 3 -wi 3 -f1 -t1 +benchmark/jmh:run +benchmark/jmh:run -h +``` + +Profiling hints: +- Java Flight Recorder +``` +benchmark/jmh:run -prof jfr:help +benchmark/jmh:run -i 2 -wi 2 -f1 -t1 -prof jfr +``` +- async-profiler (needs to be installed separately) +``` +benchmark/jmh:run -prof async:help +benchmark/jmh:run -i 2 -wi 2 -f1 -t1 -prof async +``` + +## Adding a benchmark case + +- add a function to `diesel.benchmark.BenchmarkCases` in _shared_ sources. +- integrate with JS in _js_ sources: `diesel.benchmark.DieselBenchmark` +- integrate with JVM in _jvm_ sources: `diesel.benchmark.DieselBenchmark` ## Links - https://github.com/japgolly/scalajs-benchmark From 7cd089587c46b92584009cbd759923c14fcd7547 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Thu, 25 May 2023 17:12:57 +0200 Subject: [PATCH 06/10] ignore profiling results --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 780a2a0..fff7796 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ metals.sbt async-profiler/ diesel-samples/jvm/profile* -*gpcreds.json \ No newline at end of file +*gpcreds.json +/benchmark/jvm/*/profile.jfr From 50abac7d334c6d2e382b456da986b0ea0c6a23e8 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Thu, 25 May 2023 17:13:12 +0200 Subject: [PATCH 07/10] more hints on profiling --- benchmark/README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/benchmark/README.md b/benchmark/README.md index ccb2d2c..d59a9b5 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -15,13 +15,18 @@ benchmark/jmh:run benchmark/jmh:run -h ``` -Profiling hints: -- Java Flight Recorder +### Profiling hints: +#### Java Flight Recorder ``` benchmark/jmh:run -prof jfr:help benchmark/jmh:run -i 2 -wi 2 -f1 -t1 -prof jfr ``` -- async-profiler (needs to be installed separately) + +This will write `profile.jfr` files under _jvm/_, +which can be analyzed using IntelliJ. + + +#### async-profiler (needs to be installed separately) ``` benchmark/jmh:run -prof async:help benchmark/jmh:run -i 2 -wi 2 -f1 -t1 -prof async From 7f5e15e28453321ef95c97613db6de771d8796d1 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Fri, 26 May 2023 08:48:37 +0200 Subject: [PATCH 08/10] lint fix --- .../scala/diesel/benchmark/BenchmarkCases.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala b/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala index ff06370..cf9843e 100644 --- a/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala +++ b/benchmark/shared/src/main/scala/diesel/benchmark/BenchmarkCases.scala @@ -1,3 +1,19 @@ +/* + * Copyright 2018 The Diesel Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package diesel.benchmark import diesel.samples.glsl.Glsl From c0ef354a6a55df48ea6bef413f2246fcff66ae32 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Fri, 26 May 2023 09:24:09 +0200 Subject: [PATCH 09/10] no tests in benchmark --- build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index ad7162c..822f786 100644 --- a/build.sbt +++ b/build.sbt @@ -157,7 +157,8 @@ lazy val benchmark = crossProject(JSPlatform, JVMPlatform) .settings(copyrightSettings) .settings( name := "diesel-core-benchmark", - publish / skip := true + publish / skip := true, + test := {} ) .settings(sharedSettings_scalac) .settings(sharedSettings_lint) From da64522392692166c0050c5657b719ef8a254539 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Fri, 26 May 2023 10:09:09 +0200 Subject: [PATCH 10/10] fix building JS --- benchmark/README.md | 6 +++++- benchmark/js/src/main/scala/diesel/benchmark/Main.scala | 2 +- build.sbt | 8 ++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/benchmark/README.md b/benchmark/README.md index d59a9b5..ded8aab 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -2,7 +2,11 @@ ## Scala JS -Open in [index.html](./index.html) a browser. +Build in `sbt` using +``` +benchmarkJS/fastOptJS +``` +And open in [index.html](./index.html) a browser. Use devtool profiling ... diff --git a/benchmark/js/src/main/scala/diesel/benchmark/Main.scala b/benchmark/js/src/main/scala/diesel/benchmark/Main.scala index 8f66ecb..7fa6c52 100644 --- a/benchmark/js/src/main/scala/diesel/benchmark/Main.scala +++ b/benchmark/js/src/main/scala/diesel/benchmark/Main.scala @@ -21,7 +21,7 @@ import japgolly.scalajs.benchmark.gui.BenchmarkGUI object Main { - def main(args: Array[String]) = { + def main(): Unit = { val body = document getElementById "body" BenchmarkGUI.renderSuite(body)(DieselBenchmark.suite) } diff --git a/build.sbt b/build.sbt index 822f786..166c5d4 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,6 @@ import sbt.{CrossVersion, ThisBuild} import sbtcrossproject.CrossPlugin.autoImport.crossProject - -import scala.sys.process._ +import org.scalajs.linker.interface.ModuleInitializer.mainMethod val scalaVersion2 = "2.13.10" // val scalaVersion3 = "3.2.1" @@ -168,8 +167,9 @@ lazy val benchmark = crossProject(JSPlatform, JVMPlatform) "com.github.japgolly.scalajs-benchmark" %%% "benchmark" % "0.10.0", "org.scala-js" %%% "scalajs-dom" % "2.5.0" ), - scalaJSUseMainModuleInitializer := true, + scalaJSUseMainModuleInitializer := true, + Compile / scalaJSMainModuleInitializer := Some(mainMethod("diesel.benchmark.Main", "main")), scalaJSLinkerConfig ~= { _.withSourceMap(true) }, - packageJSDependencies / skip := false + packageJSDependencies / skip := false ) .dependsOn(samples)