{"id":16538328,"url":"https://github.com/japgolly/scalajs-benchmark","last_synced_at":"2025-10-29T16:31:57.056Z","repository":{"id":2416674,"uuid":"46390066","full_name":"japgolly/scalajs-benchmark","owner":"japgolly","description":"Benchmarks: write in Scala or JS, run in your browser. Live demo:","archived":false,"fork":false,"pushed_at":"2024-08-12T21:40:43.000Z","size":127353,"stargazers_count":72,"open_issues_count":36,"forks_count":7,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-02-07T13:11:23.463Z","etag":null,"topics":["benchmark","benchmarking","scalajs","scalajs-react"],"latest_commit_sha":null,"homepage":"https://japgolly.github.io/scalajs-benchmark/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/japgolly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"japgolly"}},"created_at":"2015-11-18T02:35:13.000Z","updated_at":"2023-12-03T18:25:55.000Z","dependencies_parsed_at":"2023-11-16T16:05:30.873Z","dependency_job_id":"f5d405e8-4814-4355-ae4d-292de25ccf23","html_url":"https://github.com/japgolly/scalajs-benchmark","commit_stats":{"total_commits":392,"total_committers":6,"mean_commits":65.33333333333333,"dds":0.08673469387755106,"last_synced_commit":"3e66965cfca6b04b110e700a9fbe4c3f97d8b8f7"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japgolly%2Fscalajs-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japgolly%2Fscalajs-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japgolly%2Fscalajs-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japgolly%2Fscalajs-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/japgolly","download_url":"https://codeload.github.com/japgolly/scalajs-benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238852815,"owners_count":19541534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","benchmarking","scalajs","scalajs-react"],"created_at":"2024-10-11T18:45:01.827Z","updated_at":"2025-10-29T16:31:51.613Z","avatar_url":"https://github.com/japgolly.png","language":"Scala","funding_links":["https://patreon.com/japgolly","https://www.patreon.com/japgolly)!"],"categories":[],"sub_categories":[],"readme":"scalajs-benchmark\n=================\n\n[![Build Status](https://travis-ci.org/japgolly/scalajs-benchmark.svg?branch=master)](https://travis-ci.org/japgolly/scalajs-benchmark)\n\nBenchmarks: write in Scala or JS, run in your browser.\n\nSee an online demo here: https://japgolly.github.io/scalajs-benchmark/.\n\u003cbr\u003eThe tiny source code is here: [gh-pages/demo](https://github.com/japgolly/scalajs-benchmark/blob/gh-pages/demo/src/main/scala/demo/Main.scala).\n\n[Changelogs](doc/changelog) — [Latest: 0.10.0](doc/changelog/0.10.0.md).\n\n## How do I use it?\n\n1. Include `scalajs-benchmark` as a dependency in your Scala.JS project.\n  ```scala\n  libraryDependencies += \"com.github.japgolly.scalajs-benchmark\" %%% \"benchmark\" % \"0.10.0\"\n  ```\n\n1. You write benchmarks.\n  ```scala\n  import japgolly.scalajs.benchmark._\n  import japgolly.scalajs.benchmark.gui._\n\n  object Example {\n    val suite = GuiSuite(\n      Suite(\"Example Benchmarks\")(\n\n        // Benchmark #1\n        Benchmark(\"foreach\") {\n          var s = Set.empty[Int]\n          (1 to 100) foreach (s += _)\n          s\n        },\n\n        // Benchmark #2\n        Benchmark(\"fold\") {\n          (1 to 100).foldLeft(Set.empty[Int])(_ + _)\n        }\n      )\n    )\n  }\n  ```\n\n  *(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))*\n\n1. Add a tiny loader HTML [like this](demo/scala213-full.html).\n\n1. Create a main app and point `scalajs-benchmark` at your suite of benchmarks.\n\n  ```scala\n  import org.scalajs.dom.document\n  import japgolly.scalajs.benchmark.gui.BenchmarkGUI\n\n  object Main {\n\n    def main(args: Array[String]) = {\n      val body = document getElementById \"body\"\n      BenchmarkGUI.renderSuite(body)(Example.suite)\n    }\n  }\n  ```\n\n  If you have a library of different benchmarks, instead of using `renderSuite`,\n  you use `renderMenu` to create an app that lets the user navigate the library and\n  run benchmarks.\n\n  Example:\n\n  ```scala\n  BenchmarkGUI.renderMenu(body)(\n    suites.example.Examples.all,\n    suites.scala.all)\n  ```\n\n1. Compile; run in browser. Done.\n\n\n## Support\nIf you like what I do\n—my OSS libraries, my contributions to other OSS libs, [my programming blog](https://japgolly.blogspot.com)—\nand you'd like to support me, more content, more lib maintenance, [please become a patron](https://www.patreon.com/japgolly)!\nI do all my OSS work unpaid so showing your support will make a big difference.\n\n---\n\n*Note: This is not affiliated with the official [Scala.JS](http://www.scala-js.org/) project; it's just named to be informative rather than interesting.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjapgolly%2Fscalajs-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjapgolly%2Fscalajs-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjapgolly%2Fscalajs-benchmark/lists"}