{"id":45918135,"url":"https://github.com/yurikhordal/qbench","last_synced_at":"2026-02-28T08:01:27.171Z","repository":{"id":255082960,"uuid":"848458396","full_name":"yuriKhordal/qbench","owner":"yuriKhordal","description":"A small benchmarking \"Library\" for quick benchmarking in C.","archived":false,"fork":false,"pushed_at":"2024-08-27T21:30:43.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-27T23:05:14.814Z","etag":null,"topics":["benchmarking","c","library","simple"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuriKhordal.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-08-27T19:49:43.000Z","updated_at":"2024-08-27T21:23:25.000Z","dependencies_parsed_at":"2024-08-27T23:18:15.605Z","dependency_job_id":null,"html_url":"https://github.com/yuriKhordal/qbench","commit_stats":null,"previous_names":["yurikhordal/qbench"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yuriKhordal/qbench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuriKhordal%2Fqbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuriKhordal%2Fqbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuriKhordal%2Fqbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuriKhordal%2Fqbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuriKhordal","download_url":"https://codeload.github.com/yuriKhordal/qbench/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuriKhordal%2Fqbench/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29927926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["benchmarking","c","library","simple"],"created_at":"2026-02-28T08:01:08.583Z","updated_at":"2026-02-28T08:01:27.094Z","avatar_url":"https://github.com/yuriKhordal.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qbench\nA small benchmarking \"Library\" for quick benchmarking in C.\n\n## Installation\nTo compile as a static library: `make static` and grab the `qbench.o` and `qbench.h` files\n\nTo compile as a shared library: `make shared` and grab the `qbench.so` and `qbench.h` files\n\n## Documentation\nFull documentation is in the [wiki](https://github.com/yuriKhordal/qbench/wiki)!\n\n## Usage\nTo use the benchmarking you need to include the `qbench.h` header. Creating a new benchmark is done with `createBenchmark(title)` function, each benchmark is made up of sub-benchmarks (for example testing out the same algorithm on multiple data sets, or testing multiple algorithms against one another). To register a sub within a benchmark, the `benchSub` function is used. To run a benchmark use the `benchRun(benchmark)` function.  \nThe output of the benchmark looks like this:\n```\nBenchmark Title\n   Sub-Benchmark#1 name\n   CPU Time: [time], Real Time: [time]\n   Sub-Benchmark#2 name\n   CPU Time: [time], Real Time: [time]\n   Sub-Benchmark#3 name\n   CPU Time: [time], Real Time: [time]\n```\n\n### Example\nBenchmarking a hashtable vs a key/value tree.\n\n```c\nhashtable_init(\u0026table);\nkvtree_init(\u0026tree);\n\nbench_t *bench[3];\nbench[0] = createBenchmark(\"Get value by key\")\nbenchSub(bench[0], \"Hash Table\", table, initTableKeys, tableGetBench, releaseTableKeys);\nbenchSub(bench[0], \"KV Tree\", tree, initTreeKeys, treeGetBench, releaseTreeKeys);\n\nbench[1] = createBenchmark(\"Edit Keys\")\nbenchSub(bench[1], \"Hash Table\", table, initTableKeys, tableEditBench, releaseTableKeys);\nbenchSub(bench[1], \"KV Tree\", tree, initTreeKeys, treeEditBench, releaseTreeKeys);\n\nbench[2] = createBenchmark(\"Add Keys\")\nbenchSub(bench[2], \"Hash Table\", table, NULL, tableAddBench, NULL);\nbenchSub(bench[2], \"KV Tree\", tree, NULL, treeAddBench, NULL);\n\nif (benchRun(bench[0]) != 0) {\n   printf(\"Error: Failed to bench!\");\n}\nif (benchRun(bench[1]) != 0) {\n   printf(\"Error: Failed to bench!\");\n}\nif (benchRun(bench[2]) != 0) {\n   printf(\"Error: Failed to bench!\");\n}\n\nbenchRelease(bench[0]);\nbenchRelease(bench[1]);\nbenchRelease(bench[2]);\n\nhashtable_free(\u0026table);\nkvtree_free(\u0026tree);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyurikhordal%2Fqbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyurikhordal%2Fqbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyurikhordal%2Fqbench/lists"}