{"id":21254936,"url":"https://github.com/davidgoodwin/xdebug-function-trace-code-annotation","last_synced_at":"2025-03-15T06:19:34.986Z","repository":{"id":18922331,"uuid":"22141441","full_name":"DavidGoodwin/xdebug-function-trace-code-annotation","owner":"DavidGoodwin","description":"Munges an xdebug trace output with the source file, to make for easier analysis. Perhaps of use with large trace files (\u003e20Gb etc).","archived":false,"fork":false,"pushed_at":"2014-07-23T10:44:39.000Z","size":148,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T21:27:36.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidGoodwin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-23T10:18:43.000Z","updated_at":"2017-04-27T16:26:31.000Z","dependencies_parsed_at":"2022-08-20T19:00:37.120Z","dependency_job_id":null,"html_url":"https://github.com/DavidGoodwin/xdebug-function-trace-code-annotation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidGoodwin%2Fxdebug-function-trace-code-annotation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidGoodwin%2Fxdebug-function-trace-code-annotation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidGoodwin%2Fxdebug-function-trace-code-annotation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidGoodwin%2Fxdebug-function-trace-code-annotation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidGoodwin","download_url":"https://codeload.github.com/DavidGoodwin/xdebug-function-trace-code-annotation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690722,"owners_count":20331830,"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-11-21T03:59:12.196Z","updated_at":"2025-03-15T06:19:34.963Z","avatar_url":"https://github.com/DavidGoodwin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"xdebug-function-trace-code-annotation\n=====================================\n\nMunges an xdebug trace output with the source file, to make for easier analysis. Perhaps of use with large trace files (\u003e20Gb etc).\n\n\nUsage\n=====\n\n\n * Run an xdebug function trace ( see http://xdebug.org/docs/execution_trace ) on some code that needs optimising.\n   * Ensure the PHP ini setting for xdebug.trace_format is set to 1\n\n * Grab the output file (e.g. MyTraceFile.xt) and filter it with :\n\n```Shell\npython filter.py Module/File.php MyTraceFile.xt \u003e filtered.xt\n```\n\n * Then, merge the filtered.xt into the source code producing a report -\n\n```Shell\npython report.py filtered.xt ./path/to/Source/Code/Module/File.php \u003e report.html\n```\n\nYou'll see report.html looking a little like :\n\n```PHP\n99  ....\n100 foreach ($x as $y) {\n101 $qty = $allocationRepo-\u003egetSomethingByXAndY($y, $location);\t\n      {'....-\u003egetSomethingByXAndY': {'avg_time': 0.018434527744934828, 'count': 774700, 'total_time': 14281.22864400101} }\n\n102 if( ! $qty ) { continue ; }\n103 ....\n```\n\nYou could obviously repeat the above for all files within your application, however it's probably the case that you can pre-select the code that's more likely to be the bottleneck beforehand through simple visual analysis.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidgoodwin%2Fxdebug-function-trace-code-annotation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidgoodwin%2Fxdebug-function-trace-code-annotation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidgoodwin%2Fxdebug-function-trace-code-annotation/lists"}