Do you have memory leaks? They're harder to come by in Perl code than in a language like C or C++, though still possible. It's pretty old, but there is Devel::LeakTrace, if you believe you have one you need to track down. For me sometimes a first step is to create a test that puts a module through a lot of iterations, and then just observe "top". Old fashioned, but low effort. If that turns up anything interesting, then I spend the time to dig deeper. The two most common sources of memory leaks in Perl are circular references, and buggy XS code.
As for CPU optimization, profile first (Devel::NYTProf), and if you really do have a problem somewhere, then you can Benchmark alternatives.
-
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.
|