Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I never claimed significant speed improvement. What I had in mind is debugging thru the perl debugger. In that case the print statement becomes noise. I don't want anything to print, I even don't want to bother to go thru the statement that contains the print. Oddly, with use constant DEBUG => 0 I indeed step thru the statement that contains the print:  print "whatever\n" if DEBUG.
Worse I also step thru one line of constant.pm!

With sub DEBUG() { 0 } I still step thru the statement that contains the print. When debugging one goes from one nextstate opcode to the next. We see that consecutive nextstate statements are not fusionned as I expected them to be:

Both oneliners give me the same tree: perl -e ' sub DEBUG() { 0 } ; use O qw( Concise -exec); print "toto" if DEBUG; print "toto" if DEBUG'

perl -e ' use constant DEBUG =>0; use O qw( Concise -exec); print "tot +o" if DEBUG; print "toto" if DEBUG' 1 <0> enter 2 <;> nextstate(main 1 -e:1) v 3 <;> nextstate(main 1 -e:1) v 4 <@> leave[t1] vKP/REFC

I don't understand how I get thru one line of constant.pm when debugging using constants!!!

I tested using perl 5.6.1

-- stefp


In reply to Re: Re: inlined DEBUG constant versus $DEBUG by stefp
in thread inlined DEBUG constant versus $DEBUG by stefp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-03-29 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found