View Issue Details

IDProjectCategoryView StatusLast Update
0000037XdebugUncategorizedpublic2004-03-16 23:39
Reporterbharat Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionwon't fix 
Summary0000037: Profiling does not aggregate class methods
Description

Apologies if this is the way that it's supposed to work. I was unable to find a clear explanation of this in the docs (perhaps I did not look hard enough).

xdebug_dump_function_profile() does not appear to aggregate information about class methods into one line of output like it does for regular functions. I'm debugging a large complex application which makes extensive use of object oriented PHP and I'm trying to figure out which methods are taking up the most CPU time.

I've boiled it down into a simple example. If I run this code:

<?php

class MyClass {
function myMethod() {
; // do nothing
}
}

function MyFunction() {
$y = "blah";
}

xdebug_start_profiling();

$myClass = new MyClass();
for ($i = 0; $i < 20; $i++) {
$myClass->myMethod();
MyFunction();
}

xdebug_dump_function_profile(2);
?>

on XDebug 1.3.0 (there isn't an option for 1.3.0 in the pulldowns when I enter a bug, btw -- only 1.3.0rc1 and 1.3.0rc2) I find that it gives me one line for "MyFunction" but 20 individual lines for myMethod().

I can probably work around this by retrieving the data in array form and aggregating it myself (and I'll probably wind up doing that) but it seems natural that XDebug should do this for me.

Am I doing something wrong? Thanks!

TagsNo tags attached.
Operating SystemFreeBSD 4.8
PHP Version4.3.4

Activities

derick

2004-01-05 09:24

administrator   ~0000089

It's a bug... marking as such.

bharat

2004-01-05 09:44

reporter   ~0000090

Thanks, Derick. You'll be pleased to know that I'm using Xdebug to profile and improve Gallery 2.0 so you'll eventually reap the rewards yourself :-)

derick

2004-03-16 23:39

administrator   ~0000110

Xdebug 2 will have superior profiling capabilities and it is not very easy to fix in 1.3.x so I won't do that.

Issue History

Date Modified Username Field Change
2004-01-04 08:15 bharat New Issue
2004-01-05 09:24 derick Xdebug Version 1.3.0rc2 => 1.3.0
2004-01-05 09:24 derick Note Added: 0000089
2004-01-05 09:24 derick Category Feature/Change request => Usage problems
2004-01-05 09:44 bharat Note Added: 0000090
2004-03-16 23:39 derick Status new => resolved
2004-03-16 23:39 derick Resolution open => won't fix
2004-03-16 23:39 derick Assigned To => derick
2004-03-16 23:39 derick Note Added: 0000110
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized