Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Why does Devel::DProf report so much time in BEGIN?

by koolade (Pilgrim)
on Aug 06, 2001 at 20:32 UTC ( #102496=perlquestion: print w/replies, xml ) Need Help??

koolade has asked for the wisdom of the Perl Monks concerning the following question: (debugging)

Using Devel::DProf on some of my programs produces output such as is found at Devel::Dprof is your friend, where most of the time is shown in MODULE::BEGIN. Does anyone know what that means when there are no BEGIN blocks in the module? Or does it just represent total calls to that module's subs?

Originally posted as a Categorized Question.

  • Comment on Why does Devel::DProf report so much time in BEGIN?

Replies are listed 'Best First'.
Re: Why does Devel::DProf report so much time in BEGIN?
by mikfire (Deacon) on Aug 06, 2001 at 21:14 UTC
    Without seeing your code, but having spent some time with Devel::DProf myself, I will guess that you are use'ing a number of modules.

    If I remember correctly,

    use foo;
    is implemented as
    BEGIN { require foo; import foo; }
    So, even though you are not explicitly using BEGIN blocks, you are using them implicitly through any use statements.

    I would delve into the correct manpages and verify my memory, but I am far from any machine with perl installed on it :( And I have no ssh to get to a machine I could so use.

    mikfire

Re: Why does Devel::DProf report so much time in BEGIN?
by Anonymous Monk on May 13, 2002 at 17:31 UTC
    After tirelessly searching for an answer to the same question (hence the search that turned up this page as a result), I ended up just tweaking my code until I got an answer. Several of my subroutines were missing from the DProf report until I removed all "use strict" and "use vars" lines from my code.

    I really have no idea why this made a difference. Sure would be nice if it were better-documented.

    Anyway, not sure if this helps you out 9 months after the fact, but thought I would share.

    --Bob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://102496]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2022-08-14 00:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?