{"id":21027322,"url":"https://github.com/bynect/bench-bash","last_synced_at":"2026-05-15T20:31:22.239Z","repository":{"id":107042626,"uuid":"410045121","full_name":"bynect/bench-bash","owner":"bynect","description":"Minimal benchmarking framework in Bash","archived":false,"fork":false,"pushed_at":"2021-09-26T15:03:08.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T02:05:40.075Z","etag":null,"topics":["bash","bash-script","benchmark","benchmark-framework","benchmarking","shell","shell-script"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bynect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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}},"created_at":"2021-09-24T17:16:40.000Z","updated_at":"2021-09-26T15:03:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a50af09-905e-41b7-8836-3151f8ea846a","html_url":"https://github.com/bynect/bench-bash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bynect/bench-bash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fbench-bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fbench-bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fbench-bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fbench-bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bynect","download_url":"https://codeload.github.com/bynect/bench-bash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fbench-bash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33078898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["bash","bash-script","benchmark","benchmark-framework","benchmarking","shell","shell-script"],"created_at":"2024-11-19T11:49:29.131Z","updated_at":"2026-05-15T20:31:22.219Z","avatar_url":"https://github.com/bynect.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bench-bash\n\nA minimal benchmarking framework contained in a single bash script.\n\n## Dependencies\n\n* `bash`\n* `bc`\n* `awk`\n* `sort`\n\n## Api\n\nTo use `bench-bash` you need to source [`bench.in`](bench.in).\nYou can do this by using `.` or `source`.\n\n```\n. \"path/.../bench.in\"\n# or\nsource \"path/.../bench.in\"\n```\n\n### bench_init\n\nInitialize/reset benchmarking environment.\nCall this function instead of manually manipulating `BENCH_*` variables.\n\n```\nbench_init use_color default_log\n           |         |\n           |         `-- Log the result of benchmarks to file\n           |\n           `-- Use colors in output. Always disabled if stdout is not a terminal\n```\n\n### bench_add\n\nAdd a benchmark to the benchmarking environment.\n\n```\nbench_add name runs cmd [inf] [outf] [errf]\n          |    |    |   |     |      |\n          |    |    |   |     `-- File in which the benchmark stdout/stderr is logged\n          |    |    |   `-- File to pipe in the stdin of the benchmark. Default to nothing\n          |    |    `-- Command to run for the benchmark\n          |    `-- Number of runs for the benchmark\n          `-- Name of the benchmark. If left blank the number of the benchmark is used\n```\n\n### bench_run\n\nRun benchmarks in the benchmarking environment.\n\n```\nbench_run\n```\n\n## Example\n\nExample output, obtained from running [`test.sh`](test.sh) as of commit `ae7ae900f2c47c2dfd255d6a9f27f7b6c678cff8`.\n\n```\n$ ./test\nBenchmark Sleepy: `sleep 0.1`\n  Real time:\n    Range: 0.101 s max ... 0.101 s min\n    Mean: 0.101 s ± 0 s\n    Deviation: 0 s\n    Error: 0 s\n  User time:\n    Range: 0.001 s max ... 0.000 s min\n    Mean: 0.0009 s ± 0 s\n    Deviation: 0.0003 s\n    Error: 0 s\n  System time:\n    Range: 0.000 s max ... 0.000 s min\n    Mean: 0 s ± 0 s\n    Deviation: 0 s\n    Error: 0 s\n  Runs: 0 errors, 10 successes over 10 runs\n\nBenchmark #2: `date +%s`\n  Real time:\n    Range: 0.001 s max ... 0.001 s min\n    Mean: 0.001 s ± 0 s\n    Deviation: 0 s\n    Error: 0 s\n  User time:\n    Range: 0.001 s max ... 0.000 s min\n    Mean: 0.0003 s ± 0.0001 s\n    Deviation: 0.000458258 s\n    Error: 0.0001 s\n  System time:\n    Range: 0.000 s max ... 0.000 s min\n    Mean: 0 s ± 0 s\n    Deviation: 0 s\n    Error: 0 s\n  Runs: 0 errors, 10 successes over 10 runs\n\nBenchmark #3: `date +%N`\n  Real time:\n    Range: 0.001 s max ... 0.001 s min\n    Mean: 0.001 s ± 0 s\n    Deviation: 0 s\n    Error: 0 s\n  User time:\n    Range: 0.001 s max ... 0.000 s min\n    Mean: 0.0007 s ± 0.0001 s\n    Deviation: 0.000458258 s\n    Error: 0.0001 s\n  System time:\n    Range: 0.000 s max ... 0.000 s min\n    Mean: 0 s ± 0 s\n    Deviation: 0 s\n    Error: 0 s\n  Runs: 0 errors, 10 successes over 10 runs\n\nSummary:\n  Fastest benchmark: #3, real time mean 0.001 s ± 0 s\n  Slowest benchmark: Sleepy, real time mean 0.101 s ± 0 s\n  Total time:\n    Elapsed since run: 1 s\n    Elapsed since init: 1 s\n```\n\n## License\n\nCopyright (C) 2021 @bynect\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbynect%2Fbench-bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbynect%2Fbench-bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbynect%2Fbench-bash/lists"}