logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Problem profiling PHP function and class definitions...: msg#00015

Subject: Problem profiling PHP function and class definitions...

Hi,

 

Thanks for a great tool! Loads better than the alternatives.

 

My setup is as follows: PHP 5.1.2, IIS 5, Windows XP, php_xdebug-5.1.1-2.0.0beta5.dll

 

I’m using xdebug to profile my php application, and I noticed something odd in the “self” times of some of my scripts. It turns out that when file A does a require_once() on a file B that contains only function and class definitions, that the time spent loading the function and class definitions is not added to the self time of file B, but to the self time of file *A*.

 

Now this is understandable if the classes are only actually loaded in script A and not in script B. But there’s more.

 

In my setup, script A loads script B. Script B loads script C. Script C has class and function definitions. The time spent in C is added to B’s self time, not A’s self time!

 

Is there something about the class loading of PHP that I don’t understand?

 

Would it be possible to put entries in the profiles output for when a class or function is defined?

 

Kindest regards,

Gustav Bertram

CST Digital Communication (Pty)

 

Here’s my example code for the A loads B example.

 

Example:

 

Test.php:

“””

<?php

    require_once("class.rss.php");

    require_once("class.user.php");

    require_once("class.details.php");

    require_once("class.folder.php");

    require_once("class.message.php");

    require_once("class.draft.php");

    require_once("func.elements.php");

?>

<wml>

<card title="title">

<p>

 

qzna!

 

</p>

</card>

</wml>

“””

 

All the class.*.php contain class definitions. The func.elements.php contains function definitions. When I profile the above file, I get the following output:

 

cachegrind.out.1072788529:

“””

version: 0.9.6

cmd: C:\Inetpub\waproot\Ver2.24\test.php

part: 1

 

events: Time

 

fl=C:\Inetpub\waproot\Ver2.24\class.rss.php

fn=require_once::C:\Inetpub\waproot\Ver2.24\class.rss.php

1 40

 

fl=C:\Inetpub\waproot\Ver2.24\class.user.php

fn=require_once::C:\Inetpub\waproot\Ver2.24\class.user.php

1 28

 

fl=C:\Inetpub\waproot\Ver2.24\class.details.php

fn=require_once::C:\Inetpub\waproot\Ver2.24\class.details.php

1 69

 

fl=C:\Inetpub\waproot\Ver2.24\class.folder.php

fn=require_once::C:\Inetpub\waproot\Ver2.24\class.folder.php

1 119

 

fl=C:\Inetpub\waproot\Ver2.24\class.message.php

fn=require_once::C:\Inetpub\waproot\Ver2.24\class.message.php

1 100

 

fl=C:\Inetpub\waproot\Ver2.24\class.draft.php

fn=require_once::C:\Inetpub\waproot\Ver2.24\class.draft.php

1 11

 

fl=C:\Inetpub\waproot\Ver2.24\func.elements.php

fn=require_once::C:\Inetpub\waproot\Ver2.24\func.elements.php

1 40

 

fl=C:\Inetpub\waproot\Ver2.24\test.php

fn={main}

 

summary: 268168

 

0 267758

cfn=require_once::C:\Inetpub\waproot\Ver2.24\class.rss.php

calls=1 0 0

2 40

cfn=require_once::C:\Inetpub\waproot\Ver2.24\class.user.php

calls=1 0 0

3 28

cfn=require_once::C:\Inetpub\waproot\Ver2.24\class.details.php

calls=1 0 0

4 69

cfn=require_once::C:\Inetpub\waproot\Ver2.24\class.folder.php

calls=1 0 0

5 119

cfn=require_once::C:\Inetpub\waproot\Ver2.24\class.message.php

calls=1 0 0

6 100

cfn=require_once::C:\Inetpub\waproot\Ver2.24\class.draft.php

calls=1 0 0

7 11

cfn=require_once::C:\Inetpub\waproot\Ver2.24\func.elements.php

calls=1 0 0

8 40

“””

 

Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.firebase.por...    text.xml.xalan....    qnx.openqnx.dev...    user-groups.zar...    internationaliz...    kde.devel.konve...    finance.e-gold....    emacs.latex.pre...    gis.therion/200...    web.webmin.gene...    yellowdog.gener...    vserver/2003-08...    redhat.release....    sysutils.tivoli...    xfree86.expert/...    mail.becky.user...    hardware.netapp...    netbsd.ports.xe...    python.distutil...    boot-loaders.gr...    culture.interne...    java.springfram...    activedir/2006-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe