{"id":16314262,"url":"https://github.com/myaaghubi/debench","last_synced_at":"2025-10-25T17:30:18.763Z","repository":{"id":229486043,"uuid":"776852810","full_name":"myaaghubi/Debench","owner":"myaaghubi","description":"A small debug/benchmark helper for PHP","archived":false,"fork":false,"pushed_at":"2024-09-29T11:18:05.000Z","size":1568,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T09:22:04.622Z","etag":null,"topics":["benchmark","debench","debug","php","tool"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/myaaghubi.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,"publiccode":null,"codemeta":null}},"created_at":"2024-03-24T16:19:13.000Z","updated_at":"2024-09-29T10:25:15.000Z","dependencies_parsed_at":"2024-04-08T14:41:25.895Z","dependency_job_id":"2907849c-9a8f-44c7-a839-87c832b7ffce","html_url":"https://github.com/myaaghubi/Debench","commit_stats":null,"previous_names":["myaaghubi/debench"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myaaghubi%2FDebench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myaaghubi%2FDebench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myaaghubi%2FDebench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myaaghubi%2FDebench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myaaghubi","download_url":"https://codeload.github.com/myaaghubi/Debench/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238183476,"owners_count":19430125,"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":["benchmark","debench","debug","php","tool"],"created_at":"2024-10-10T21:53:31.409Z","updated_at":"2025-10-25T17:30:18.756Z","avatar_url":"https://github.com/myaaghubi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Debench\n[![Test Debench](https://github.com/myaaghubi/Debench/actions/workflows/ci.yml/badge.svg)](https://github.com/myaaghubi/Debench/actions/workflows/ci.yml) [![Debench Coverage Status](https://coveralls.io/repos/github/myaaghubi/Debench/badge.svg?branch=main)](https://coveralls.io/github/myaaghubi/Debench?branch=main) ![Debench release (latest by date)](https://img.shields.io/github/v/release/myaaghubi/Debench) ![Debench License](https://img.shields.io/github/license/myaaghubi/Debench)\n\nA small and lightweight debug/benchmark helper for PHP.\n\n![myaaghubi/debench-debench-minimal](screenshot/screenshot-minimal.png)\n![myaaghubi/debench-debench-fullsize](screenshot/screenshot-fullsize.png)\n\n# How to use\n\nUse composer:\n```shell\ncomposer require myaaghubi/debench\n```\nThen have it like:\n```php\nnamespace DEBENCH;\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n// call it from your index.php after autoload \n// then check the webpage with your browser\n// $debench = new Debench(true, '../public', $base-\u003eget('ASSETS'));\nDebench::getInstance(true, '../public', $base-\u003eget('ASSETS'));\n\n// for enable() or minimalOnly() you can \n// call them even before getInstance\nDebench::enable(false);\n\n// for dump(), info(), warning() and error() you can \n// call them before getInstance too\nDebench::info('let\\'s use some memory');\n\n// let's load some\n$st = str_repeat(\"Debench!\", 10000);\nDebench::point('one');\nDebench::dump($st);\n\n// let's load some more\n$st .= str_repeat(\"Debench!\", 10000);\n// $debench-\u003enewPoint(\"two\");\nDebench::point('two');\n```\nFor `minimal` mode:\n```php\n// it is safe and secure to use\n// $debench-\u003esetMinimalOnly(true);\nDebench::minimalOnly(true);\n```\nFor `production` mode\n```php\n// it's better to do it on initializing\n//$debench = new Debench(false);\nDebench::getInstance(false);\n// or\nDebench::enable(false);\n```\nFor `comparison` mode\n```php\n// Debench::compare($func1, $func2, $tag='', $iterations=1000);\nDebench::compare(function () use ($mongo) {\n    $mongo-\u003efind([])\n}, function () use ($sql) {\n    $sql-\u003eexec('select ...');\n});\n```\n\n# How to test\nJust run:\n```\n./vendor/bin/phpunit\n```\n\n## License\n\nYou are allowed to use this plugin under the terms of the MIT License.\n\nCopyright (C) 2025 Mohammad Yaaghubi","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyaaghubi%2Fdebench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyaaghubi%2Fdebench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyaaghubi%2Fdebench/lists"}