MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000037XdebugUsage problems (Wrong Results)public2004-01-04 08:152004-03-16 23:39
Reporterbharat 
Assigned Toderick 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionwon't fix 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000037: Profiling does not aggregate class methods
DescriptionApologies 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
Attached Files

- Relationships

-  Notes
(0000089)
derick (administrator)
2004-01-05 09:24

It's a bug... marking as such.
(0000090)
bharat (reporter)
2004-01-05 09:44

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 :-)
(0000110)
derick (administrator)
2004-03-16 23:39

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 13:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 13:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker