{"id":13562153,"url":"https://github.com/membraneframework/beamchmark","last_synced_at":"2025-06-26T02:03:24.285Z","repository":{"id":38241271,"uuid":"430710418","full_name":"membraneframework/beamchmark","owner":"membraneframework","description":"Elixir tool for benchmarking EVM performance","archived":false,"fork":false,"pushed_at":"2023-11-17T14:52:03.000Z","size":1142,"stargazers_count":83,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-09T15:18:09.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/membraneframework.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-22T13:07:54.000Z","updated_at":"2025-02-11T16:35:37.000Z","dependencies_parsed_at":"2023-11-17T16:12:49.134Z","dependency_job_id":null,"html_url":"https://github.com/membraneframework/beamchmark","commit_stats":{"total_commits":48,"total_committers":9,"mean_commits":5.333333333333333,"dds":0.5625,"last_synced_commit":"bbb35940a5c257dab5a81043da67b93dafcce9b9"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/membraneframework/beamchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fbeamchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fbeamchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fbeamchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fbeamchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/membraneframework","download_url":"https://codeload.github.com/membraneframework/beamchmark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fbeamchmark/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261984644,"owners_count":23240302,"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":[],"created_at":"2024-08-01T13:01:05.196Z","updated_at":"2025-06-26T02:03:24.263Z","avatar_url":"https://github.com/membraneframework.png","language":"Elixir","funding_links":[],"categories":["Benchmarking"],"sub_categories":[],"readme":"# Beamchmark\n[![Hex.pm](https://img.shields.io/hexpm/v/beamchmark.svg)](https://hex.pm/packages/beamchmark)\n[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/beamchmark)\n[![CircleCI](https://circleci.com/gh/membraneframework/beamchmark.svg?style=svg)](https://circleci.com/gh/membraneframework/beamchmark)\n\nTool for measuring EVM performance.\n\nAt the moment, the main interest of Beamchmark is scheduler utilization, reductions and the number of context switches.\nFor more information please refer to API docs.\nCurrently, Beamchmark is supported on macOS, Linux and partially on Windows.\n\n## Beamchmark and Benchee\nBeamchmark should be used when you want to measure BEAM performance while it is running your application.\nBenchee should be used when you want to benchmark specific function from your code base.\nIn particular, Benchee will inform you how long your function is executing, while Beamchmark will inform you\nhow busy BEAM is.\n\n## Installation\nThe package can be installed by adding `beamchmark` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:beamchmark, \"~\u003e 1.4.1\"}\n  ]\nend\n```\n\n## Usage\n\n### Running an application using `Beamchmark.Scenario`\n\nYou create a test scenario by adopting `Beamchmark.Scenario` behaviour in a module. It has to implement `run()` function, which will execute for benchmarking.\n\nThe examples of using `Scenario` are located in the `examples` directory.\nTo run one of them, simply use the following command: \n\n```bash\nmix run examples/\u003cexample_name\u003e.exs\n```\n\n### Running Beamchmark in an attached mode\n\nIf you want to measure the performance of an already running BEAM you can run Beamchmark in an attached mode.\nHowever, it is required that the node on which your application is running is a distributed node and has `Beamchmark` added to its dependencies.\n\nTo run an example of Beamchmark in attached mode first start the node, which performance will be measured:\n```bash\ncd examples/attached\nmix deps.get\nelixir --sname counter@localhost -S mix run start_counter.exs\n```\nThe node will be visible under `counter@localhost` name.\n\nNow in another terminal you can start the benchmark:\n```bash\nepmd -daemon \nmix run examples/attached/run_attached.exs\n```\n\n## Formatters\nYou can output benchmark results with Beamchmark's built-in formatters or implement a custom one.\nFormatters can also compare new results with the previous ones, given they share the same scenario module and \nwere configured to run for the same amount of time.\n\nCurrently, you can output Beamchmark reports in the following ways:\n* `Beamchmark.Formatters.Console`\n\n  This is the default formatter, it will print the report on standard output.\n\n  ```txt\n  ================\n  SYSTEM INFO\n  ================\n\n  Elixir version: 1.13.4\n  OTP version: 24\n  OS: macOS\n  Memory: 16 GB\n  System arch: x86_64-apple-darwin21.3.0\n  NIF version: 2.16\n  Cores: 8\n\n  ================\n  CONFIGURATION\n  ================\n\n  Delay: 5s\n  Duration: 15s\n\n  ================\n  MEASUREMENTS\n  ================\n\n  Normal schedulers\n  --------------------\n  1 0.7462382700312585 74.6%\n  2 0.7552131238891551 75.5%\n  3 0.7080346117265083 70.8%\n  4 0.6840002812013201 68.4%\n  5 0.7357487054135822 73.6%\n  6 0.7889711402496832 78.9%\n  7 0.7053186570052465 70.5%\n  8 0.495807853995791 49.6%\n  Total: 0.7024165804390681 70.2%\n\n  CPU schedulers\n  --------------------\n  9 0.39409732340500314 39.4%\n  10 0.5194739765841625 51.9%\n  11 0.45208160433332006 45.2%\n  12 0.33614215325750824 33.6%\n  13 0.05474778835410803 5.5%\n  14 0.31687236471324787 31.7%\n  15 0.06046101946449905 6.0%\n  16 0.0 0.0%\n  Total: 0.2667345287639811 26.7%\n\n  IO schedulers\n  --------------------\n  17 0.0 0.0%\n  18 0.0 0.0%\n  19 0.0 0.0%\n  20 0.0 0.0%\n  21 0.0 0.0%\n  22 0.0 0.0%\n  23 0.0 0.0%\n  24 0.0 0.0%\n  25 2.7705124922689514e-4 0.0%\n  26 0.0 0.0%\n  Total: 2.7705124922689516e-5 0.0%\n\n  Weighted\n  --------------------\n  0.9692071705951804 96.9%\n\n\n  Reductions\n  --------------------\n  2847054520\n\n  Context Switches\n  --------------------\n  717845\n\n  CPU Usage Average\n  --------------------\n  51.2%\n\n  CPU Usage Per Core\n  --------------------\n  Core: 0 -\u003e 99.81 %\n  Core: 1 -\u003e 2.84 %\n  Core: 2 -\u003e 99.81 %\n  Core: 3 -\u003e 2.57 %\n  Core: 4 -\u003e 99.82 %\n  Core: 5 -\u003e 2.23 %\n  Core: 6 -\u003e 99.88 %\n  Core: 7 -\u003e 2.6 %\n\n  Memory usage\n  --------------------\n  3.56 GB\n\n  ================\n  NEW MEASUREMENTS\n  ================\n\n  Normal schedulers\n  --------------------\n  1 0.7391849466705548 73.9%  -0.007053323360703745 -0.9383378016085686%\n  2 0.6451374210660318 64.5%  -0.11007570282312329 -14.569536423841058%\n  3 0.612116497924041 61.2%  -0.09591811380246729 -13.559322033898297%\n  4 0.7119528248221814 71.2%  0.027952543620861303 4.093567251461991%\n  5 0.7175675964576803 71.8%  -0.01818110895590186 -2.4456521739130324%\n  6 0.667647106911744 66.8%  -0.12132403333793917 -15.335868187579223%\n  7 0.7588791891435591 75.9%  0.05356053213831258 7.659574468085111%\n  8 0.7007975884343178 70.1%  0.2049897344385268 41.330645161290306%\n  Total: 0.6941603964287638 69.4%  -0.008256184010304257 -1.139601139601126%\n\n  CPU schedulers\n  --------------------\n  9 0.40317586539492 40.3%  0.009078541989916866 2.284263959390856%\n  10 0.0658197960010861 6.6%  -0.4536541805830764 -87.28323699421965%\n  11 0.207488920931131 20.7%  -0.24459268340218907 -54.20353982300885%\n  12 0.4070941615062336 40.7%  0.07095200824872538 21.130952380952394%\n  13 0.5912324517586194 59.1%  0.5364846634045114 974.5454545454545%\n  14 4.213003273973723e-8 0.0%  -0.3168723225832151 -100%\n  15 0.5185116282961778 51.9%  0.45805060883167875 765.0%\n  16 0.014049861167737257 1.4%  0.014049861167737257 nan\n  Total: 0.27592159089824225 27.6%  0.009187062134261126 3.37078651685394%\n\n  IO schedulers\n  --------------------\n  17 0.0 0.0%  0.0 0%\n  18 0.0 0.0%  0.0 0%\n  19 0.0 0.0%  0.0 0%\n  20 0.0 0.0%  0.0 0%\n  21 0.0 0.0%  0.0 0%\n  22 0.0 0.0%  0.0 0%\n  23 0.0 0.0%  0.0 0%\n  24 0.0 0.0%  0.0 0%\n  25 0.0 0.0%  -2.7705124922689514e-4 0%\n  26 2.2108785953999204e-4 0.0%  2.2108785953999204e-4 0%\n  Total: 2.2108785953999205e-5 0.0%  -5.596338968690311e-6 0%\n\n  Weighted\n  --------------------\n  0.9700717546422247 97.0%  8.6458404704437e-4 0.10319917440659765%\n\n\n  Reductions\n  --------------------\n  2621243405  -225811115 -7.931394127289138%\n\n  Context Switches\n  --------------------\n  666449  -51396 -7.159762901462017%\n\n  CPU Usage Average\n  --------------------\n  51.88%  0.68% 1.34%\n\n  CPU Usage Per Core\n  --------------------\n  Core 0 -\u003e 99.74%  -0.07 -0.07 %\n  Core 1 -\u003e 4.35%  1.51 53.17 %\n  Core 2 -\u003e 99.83%  0.01 0.01 %\n  Core 3 -\u003e 3.96%  1.39 53.96 %\n  Core 4 -\u003e 99.82%  0.01 0.01 %\n  Core 5 -\u003e 3.75%  1.52 68.44 %\n  Core 6 -\u003e 99.76%  -0.12 -0.12 %\n  Core 7 -\u003e 3.83%  1.22 46.91 %\n\n  Memory usage\n  --------------------\n  3.58 GB  21.96 MB 0.6%\n  ```\n\n* `Beamchmark.Formatters.HTML`\n\n  The HTML formatter will save the report to an HTML file.\n  \n  ![Screenshot of an HTML report](https://user-images.githubusercontent.com/48837433/172619856-44e1280d-b361-4fb9-941a-11c83bde6e47.png)\n\n\n* Custom formatters\n\n  You can implement your custom formatters by overriding `Beamchmark.Formatter` behaviour.\n\n## Copyright and License\nCopyright 2021, [Software Mansion](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=beamchmark)\n\n[![Software Mansion](https://logo.swmansion.com/logo?color=white\u0026variant=desktop\u0026width=200\u0026tag=membrane-github)](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=beamchmark)\n\nLicensed under the [Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fbeamchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmembraneframework%2Fbeamchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fbeamchmark/lists"}