{"id":13800655,"url":"https://github.com/hdgarrood/purescript-benchotron","last_synced_at":"2026-01-23T20:39:25.400Z","repository":{"id":32165249,"uuid":"35738465","full_name":"hdgarrood/purescript-benchotron","owner":"hdgarrood","description":"Straightforward benchmarking for PureScript/JavaScript.","archived":false,"fork":false,"pushed_at":"2023-09-23T22:37:23.000Z","size":71,"stargazers_count":31,"open_issues_count":6,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-11-11T21:12:41.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PureScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hdgarrood.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2015-05-16T20:08:17.000Z","updated_at":"2025-08-20T13:19:21.000Z","dependencies_parsed_at":"2024-01-30T04:13:29.569Z","dependency_job_id":null,"html_url":"https://github.com/hdgarrood/purescript-benchotron","commit_stats":{"total_commits":83,"total_committers":10,"mean_commits":8.3,"dds":0.1325301204819277,"last_synced_commit":"12e93b16aa4f3835728832c53502516cc1a9800c"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/hdgarrood/purescript-benchotron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdgarrood%2Fpurescript-benchotron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdgarrood%2Fpurescript-benchotron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdgarrood%2Fpurescript-benchotron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdgarrood%2Fpurescript-benchotron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hdgarrood","download_url":"https://codeload.github.com/hdgarrood/purescript-benchotron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdgarrood%2Fpurescript-benchotron/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28699685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T17:25:48.045Z","status":"ssl_error","status_checked_at":"2026-01-23T17:25:47.153Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-08-04T00:01:14.755Z","updated_at":"2026-01-23T20:39:25.372Z","avatar_url":"https://github.com/hdgarrood.png","language":"PureScript","readme":"# purescript-benchotron\n\n[![Build Status](https://travis-ci.org/hdgarrood/purescript-benchotron.svg?branch=master)](https://travis-ci.org/hdgarrood/purescript-benchotron)\n\nStraightforward benchmarking via [Benchmark.js][]. I am sorry about the name\n(purescript-benchmark was taken).\n\n## usage\n\nSuppose you want to find out which is faster out of `foldr (+) 0` and\n`runAdditive \u003c\u003c\u003c foldMap Additive`. Let's also do the same for `(*)` for good\nmeasure. Start by creating some `Benchmark` values:\n\n```purescript\nmodule Main where\n\nimport Prelude\nimport Control.Monad.Eff (Eff)\nimport Data.Array ((..))\nimport Data.Foldable (foldMap, foldr)\nimport Data.Monoid.Additive (Additive(..))\nimport Data.Monoid.Multiplicative (Multiplicative(..))\nimport Data.Newtype (ala)\nimport Test.QuickCheck.Arbitrary (arbitrary)\nimport Test.QuickCheck.Gen (vectorOf)\nimport Benchotron.Core (Benchmark, benchFn, mkBenchmark)\nimport Benchotron.UI.Console (runSuite)\n\nbenchSum :: Benchmark\nbenchSum = mkBenchmark\n  { slug: \"sum\"\n  , title: \"Finding the sum of an array\"\n  , sizes: (1..5) \u003c#\u003e (_ * 1000)\n  , sizeInterpretation: \"Number of elements in the array\"\n  , inputsPerSize: 1\n  , gen: \\n -\u003e vectorOf n arbitrary\n  , functions: [ benchFn \"foldr\" (foldr (+) 0)\n               , benchFn \"foldMap\" (ala Additive foldMap)\n               ]\n  }\n\nbenchProduct :: Benchmark\nbenchProduct = mkBenchmark\n  { slug: \"product\"\n  , title: \"Finding the product of an array\"\n  , sizes: (1..5) \u003c#\u003e (_ * 1000)\n  , sizeInterpretation: \"Number of elements in the array\"\n  , inputsPerSize: 1\n  , gen: \\n -\u003e vectorOf n arbitrary\n  , functions: [ benchFn \"foldr\" (foldr (*) 1)\n               , benchFn \"foldMap\" (ala Multiplicative foldMap)\n               ]\n  }\nmain :: Effect Unit\nmain = runSuite [benchSum, benchProduct]\n```\n\nNow, run them with `runSuite`; this will save the results data for each\nbenchmark to `tmp/sum.json` and `tmp/product.json` respectively.\n\n```purescript\nmain = runSuite [benchSum, benchProduct]\n```\n\nYou can now generate SVG graphs of these results by visiting\n\u003chttp://harry.garrood.me/purescript-benchotron-svg-renderer\u003e.\n\nFurther information, such as the meaning of each of the fields of a\n`Benchmark` value, is available in the\n[documentation on Pursuit](https://pursuit.purescript.org/packages/purescript-benchotron).\n\n[Benchmark.js]: http://benchmarkjs.com\n","funding_links":[],"categories":["Testing"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdgarrood%2Fpurescript-benchotron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhdgarrood%2Fpurescript-benchotron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdgarrood%2Fpurescript-benchotron/lists"}