Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
That certainly helps, though I would still like to see numbers!

My guess as to why noone has written a module for that is that it is of no great concern.

Example, I have a generated perl file that basically was created to optimise a very heavily nested set of loops (over 100), by unrolling those loops.

It is just under 4MB in size:

07/06/2018 01:44 3,959,242 gened.pl 1 File(s) 3,959,242 bytes

And consists of just over 50kloc:

C:\test>wc -l gened.pl 50405 gened.pl

When run, it executes 2.3 million lines:

C:\test>perl -d:Trace gened.pl >log 2>&1 C:\test>dir log 07/06/2018 01:49 2,334,425 log 1 File(s) 2,334,425 bytes

I just tacked these two line to the bottom of the file:

sub mem2{ `tasklist /nh /fi "PID eq $$"` =~ m[(\S+ K)$]; } print mem2;

And when run, it produces:

[ 1:52:14.81] C:\test>tail gened.pl X4: L4( $s, $e, $p ); X3: L3( $s, $e, $p ); X2: L2( $s, $e, $p ); X1: L1( $s, $e, $p ); } Xsub( 99, 88, 77 ); sub mem2{ `tasklist /nh /fi "PID eq $$"` =~ m[(\S+ K)$]; } print mem2; [ 1:53:47.89] C:\test>gened 187,124 K

So 50kloc of code compiles to <200MB of memory.

Unless you're using Moose, the size of the code usually pales in significance with respect to the data. And the great benefit of properly optimised debug blocks is the removal of the condition test within inner loops and the runtime it saves.

Not what you want to hear, but it might set your mind at rest about a few lines of debug.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit

In reply to Re^3: way to find module memory usage? by BrowserUk
in thread way to find module memory usage? by perl-diddler

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 rifling through the Monastery: (2)
As of 2024-04-20 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found