Note: This is my completely personal view. If you don't agree, i fully understand. In my opinion, program optimization is just as much art as it is technical. And art is in the eye of the beholder...

That really, completely depends on the problem your program is trying to solve and the way you implemented it. Not for every problem, "Code optimization" is really the best choice. Personally, the first thing i do is think about the design choices i make/made and try to see if there are better ones.

For example:

I could probably continue the list for another 50 to 200 items, but you get get the basic idea.

In short: In-depth source code optimization should be one of the last steps. First, check that the basic program design is sound and you are not constrained by external limitations. If everything else checks out, then you go fiddling with algorithms, re-ordering loops and making unreadable code...

"You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."

In reply to Re: Performance improvement in perl scripts by cavac
in thread Performance improvement in perl scripts by balakrishnan

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.