{"id":15525110,"url":"https://github.com/staabm/hungry-spl-file-info","last_synced_at":"2025-06-25T22:06:32.696Z","repository":{"id":202714519,"uuid":"707975502","full_name":"staabm/hungry-spl-file-info","owner":"staabm","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-21T08:09:07.000Z","size":14690,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-05T11:39:13.170Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/staabm.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}},"created_at":"2023-10-21T06:28:13.000Z","updated_at":"2024-04-28T00:42:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ed35457-b7b9-4946-8a81-499934166451","html_url":"https://github.com/staabm/hungry-spl-file-info","commit_stats":null,"previous_names":["staabm/hungry-spl-file-info"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/staabm/hungry-spl-file-info","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staabm%2Fhungry-spl-file-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staabm%2Fhungry-spl-file-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staabm%2Fhungry-spl-file-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staabm%2Fhungry-spl-file-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staabm","download_url":"https://codeload.github.com/staabm/hungry-spl-file-info/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staabm%2Fhungry-spl-file-info/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261960542,"owners_count":23236574,"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-10-02T10:54:47.443Z","updated_at":"2025-06-25T22:06:32.675Z","avatar_url":"https://github.com/staabm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# misleading profilling results\n\nthe following profiles should code examples which have pretty similar runtime characteristics when run via php CLI, but show vastly different profiles when running thru blackfire.\n\n-\u003e getting vastly different profiles for code which runs nearly identical without blackfire leads to unnecessary optimization work, which does not yield a optimized result. the tooling suggest code would improve when e.g. re-working from symfony/finder to plain directory-iterators, but the end user will not see a difference - which is frustrating.\n\n-\u003e devs worked on a problem which didn't exist\n\n-\u003e the client paid for performance work which did not yield improvements (or only improvements the tooling reports, but does not translate to real world application)\n\n## find\n\n### repro\n\nhttps://github.com/staabm/hungry-spl-file-info/commit/b1f24c746c77fab019d4945410a2f7c6cd1a88fe\n\n\nwhile running the scripts with regular php has nearly the same impact\n\n \n```\n➜  hungry-spl-file-info git:(main) ✗ php plain.php \nElapsed time: 31 ms\nCURRENT_AS_PATHNAME: no\nNum files 6144\nUsed memory: 2 MB\n➜  hungry-spl-file-info git:(main) php plain.php spl\nElapsed time: 32 ms\nCURRENT_AS_PATHNAME: yes\nNum files 6144\nUsed memory: 2 MB\n➜  hungry-spl-file-info git:(main) php symfony.php  \nElapsed time: 39 ms\nNum files 6115\nUsed memory: 2 MB\n```\n\nwhen running these 3 scripts thru blackfire, we see a totally different picture\n\n```\n➜  hungry-spl-file-info git:(main) ✗ blackfire run php plain.php   \nElapsed time: 76 ms\nCURRENT_AS_PATHNAME: no\nNum files 6144\nUsed memory: 4 MB\n\nWall Time    79.2ms\nI/O Wait     4.25ms\nCPU Time       75ms\nMemory       1.94MB\nNetwork         n/a     n/a     n/a\nSQL             n/a     n/a\n\n➜  hungry-spl-file-info git:(main) ✗ blackfire run php plain.php spl\nElapsed time: 84 ms\nCURRENT_AS_PATHNAME: yes\nNum files 6144\nUsed memory: 6 MB\n\nCPU Time     81.5ms\nMemory       3.66MB\nWall Time    86.7ms\nI/O Wait     5.17ms\nNetwork         n/a     n/a     n/a\nSQL             n/a     n/a\n\n➜  hungry-spl-file-info git:(main) ✗ blackfire run php symfony.php  \nElapsed time: 386 ms\nNum files 6115\nUsed memory: 6 MB\n\nMemory       3.86MB\nWall Time     388ms\nI/O Wait     14.8ms\nCPU Time      374ms\nNetwork         n/a     n/a     n/a\nSQL             n/a     n/a\n```\n \n\n## Setup \n\n```\nphp -v\nPHP 8.2.11 (cli) (built: Sep 26 2023 11:11:58) (NTS)\nCopyright (c) The PHP Group\nZend Engine v4.2.11, Copyright (c) Zend Technologies\n    with blackfire v1.86.3~mac-x64-non_zts82, https://blackfire.io, by Blackfire\n\nblackfire -V\nBlackfire version 2.22.0 (c) 2014-2023 Platform.sh (2023-09-28T09:21:28+0000 - dev)\n```\n\nrunning latest macos on a M1 Pro.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaabm%2Fhungry-spl-file-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaabm%2Fhungry-spl-file-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaabm%2Fhungry-spl-file-info/lists"}