Description
Benchmarks: write in Scala or JS, run in your browser.
See an online demo here: https://japgolly.github.io/scalajs-benchmark/.
The tiny source code is here: gh-pages/demo.
scalajs-benchmark alternatives and similar packages
Based on the "Tools" category.
Alternatively, view scalajs-benchmark alternatives based on common mentions on social networks and blogs.
-
Gitbucket
A Git platform powered by Scala with easy installation, high extensibility & GitHub API compatibility -
bloop
Bloop is a build server and CLI tool to compile, test and run Scala fast from any editor or build tool. -
Scurses
Scurses, terminal drawing API for Scala, and Onions, a Scurses framework for easy terminal UI -
scala-trace-debug
Macro based print debugging. Locates log statements in your IDE. -
fast-string-interpolator
Scala macro that generates ultra-fast string interpolators. -
dregrex
Dregex is a JVM library that implements a regular expression engine using deterministic finite automata (DFA). It supports some Perl-style features and yet retains linear matching time, and also offers set operations. -
pos
Macro based print debugging. Locates debug statements in your IDE. Supports logging. -
Giter8
command line tool to generate files and directories from templates published on Github
Access the most powerful time series database as a service
Do you think we are missing an alternative of scalajs-benchmark or a related project?
README
scalajs-benchmark
Benchmarks: write in Scala or JS, run in your browser.
See an online demo here: https://japgolly.github.io/scalajs-benchmark/. The tiny source code is here: gh-pages/demo.
[Changelogs](doc/changelog) โ [Latest: 0.8.0](doc/changelog/0.8.0.md).
How do I use it?
Include
scalajs-benchmark
as a dependency in your Scala.JS project.libraryDependencies += "com.github.japgolly.scalajs-benchmark" %%% "benchmark" % "0.8.0"
You write benchmarks.
import japgolly.scalajs.benchmark._ import japgolly.scalajs.benchmark.gui._
object Example { 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])(_ + _)
}
)
)
}
*(Hey, can you make that `1 to 100` configurable in the GUI? [You sure can.](https://github.com/japgolly/scalajs-benchmark/blob/master/demo/src/main/scala/demo/suites/example/Examples.scala))*
1. Add a tiny loader HTML [like this](demo/scala213-full.html).
1. Create a main app and point `scalajs-benchmark` at your suite of benchmarks.
```scala
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)(Example.suite)
}
}
If you have a library of different benchmarks, instead of using renderSuite
,
you use renderMenu
to create an app that lets the user navigate the library and
run benchmarks.
Example:
BenchmarkGUI.renderMenu(body)(
suites.example.Examples.all,
suites.scala.all)
- Compile; run in browser. Done.
Support
If you like what I do โmy OSS libraries, my contributions to other OSS libs, my programming blogโ and you'd like to support me, more content, more lib maintenance, please become a patron! I do all my OSS work unpaid so showing your support will make a big difference.
Note: This is not affiliated with the official Scala.JS project; it's just named to be informative rather than interesting.