{"id":30450192,"url":"https://github.com/nochso/benchmark","last_synced_at":"2025-08-23T13:25:56.597Z","repository":{"id":57027920,"uuid":"43171480","full_name":"nochso/Benchmark","owner":"nochso","description":"[ABANDONED] Create pretty HTML benchmarks with reliable results.","archived":false,"fork":false,"pushed_at":"2016-04-18T21:44:03.000Z","size":231,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-02T06:07:59.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nochso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-25T19:32:56.000Z","updated_at":"2017-02-25T08:35:08.000Z","dependencies_parsed_at":"2022-08-23T16:20:42.962Z","dependency_job_id":null,"html_url":"https://github.com/nochso/Benchmark","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/nochso/Benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2FBenchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2FBenchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2FBenchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2FBenchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nochso","download_url":"https://codeload.github.com/nochso/Benchmark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2FBenchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271749048,"owners_count":24814115,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"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":[],"created_at":"2025-08-23T13:25:54.019Z","updated_at":"2025-08-23T13:25:56.579Z","avatar_url":"https://github.com/nochso.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nochso/benchmark library\n\n[![Latest Stable Version](https://poser.pugx.org/nochso/benchmark/v/stable)](https://packagist.org/packages/nochso/benchmark)\n[![License](https://poser.pugx.org/nochso/benchmark/license)](LICENSE)\n\nnochso/benchmark creates pretty HTML benchmarks from any closures you supply:\n\n- Generate HTML reports including Github flavoured Markdown\n- Reliably compare different algorithms\n- Run tests for a minimum amount of time to ensure stable results\n\n[**View an example report**](http://nochso.github.io/Benchmark/reports/search.html)\n\n[**View the API documentation**](http://nochso.github.io/Benchmark/docs/nochso/Benchmark.html)\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Contributing](#contributing)\n* [History](#history)\n* [Credits](#credits)\n* [License](#license)\n\n## Installation\n\n1. Install composer on [Linux / Unix / OSX][composeru] or [Windows][composerw]\n2. Require this package via composer:\n\n    ```sh\n    composer require nochso/benchmark\n    ```\n\n## Usage\n\nHave a look at the [example reports](reports/).\n\nA very simple example without parameters:\n\n```php\n$report = new Report('My report name');\n$unit = new Unit('Encryption speed');\n$unit-\u003eaddClosure(function ($n) {\n    while ($n--) {\n        $x = str_rot13('secret');\n    }\n}, 'rot13');\n$unit-\u003eaddClosure(function ($n) {\n    while ($n--) {\n        $x = str_rot13(str_rot13('secret'));\n    }\n}, 'rot26');\n$report-\u003eunitList-\u003eadd($unit);\n$report-\u003erun();\n```\n\nThis will generate and save a HTML report to folder `build` by default.\n\n### Options\n\nThe Report constructor takes an optional third argument `$config`:\n\n```php\npublic function __construct($title, $description = '', $config = array())\n```\n\nIf omitted, default options will be used. Otherwise your configuration will be merged with the defaults.\n\n```php\narray(\n    'template_dir' =\u003e 'template',\n    'output_dir'   =\u003e 'build',\n    'twig'         =\u003e array(\n        'cache'            =\u003e 'cache/twig',\n        'auto_reload'      =\u003e true,\n        'strict_variables' =\u003e true,\n    ),\n)\n```\n\nYou can also change the minimum duration of tests which defaults to 1000 millseconds (1 second):\n```php\n\\nochso\\Benchmark\\Timer::$defaultMinDuration = 1000;\n```\n\n## Contributing\n\n1. [Open an issue](https://github.com/nochso/benchmark/issues/new) if it's worth discussing.\n2. Fork this project on Github.\n3. Clone your fork: `git clone git@github.com:yourname/benchmark.git`\n4. Don't forget to `composer update`\n4. Create your feature branch: `git checkout -b my-new-feature`\n5. Commit your changes: `git commit -am 'Add some feature'`\n6. Push to the branch: `git push origin my-new-feature`\n7. Submit a pull request on Github :)\n\n## Change log\nSee [CHANGELOG](CHANGELOG.md).\n\n## Credits\n\n- [Marcel Voigt](https://github.com/nochso)\n\n## License\nThis project is licensed under the ISC license which is MIT/GPL compatible and FSF/OSI approved:\n\n```\nCopyright (c) 2015, Marcel Voigt \u003cmv@noch.so\u003e\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n```\n\n[composeru]: \"https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx\"\n[composerw]: \"https://getcomposer.org/doc/00-intro.md#installation-windows\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnochso%2Fbenchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnochso%2Fbenchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnochso%2Fbenchmark/lists"}