Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I think you'll agree with what I'm about to say, but I think it's an important point to reiterate.

You wrote: ...performance is important, and it is always one of the most important measurement of the quality of your application.

In a paper defending the virtues of goto, Knuth wrote about looking forward to the day when computers were fast enough that performance is no longer such a critical concern. Interestingly, his comments relate to yours in two different ways. He was making it clear that performance a necessary consideration but, more importantly, he was directly addressing the "never use goto" dogma that had arisen. (As a third point of relevance, I got that link from the HOP mailing list).

The problem with the dogma was fairly simple: by using "always" as the criteria, one was sometimes forced to go to extreme lengths to avoid goto and this could cause performance issues. In your case, you state that performance is always one of the most important considerations. I tend to disagree.

Admittedly, there are certain classes of problems for which performance issues must be addressed up front. Ray tracing programs are rarely written in Perl. In this case, a better solution that figuring out how to improve the performance of your favorite tool is to figure out the most appropriate tool for the job. C or C++ are going to be big wins here.

If I am forced to pick a "most important" measure of quality, I would argue for program completeness and correctness. In other words, the program should correctly do everything that it is supposed to do and do nothing it's not required to do. Once you have correctness and completeness down then, if performance is still an issue, profiling should be considered.

Sometimes performance is gained by coupling things that shouldn't be coupled, denormalizing the database or writing an obscure algorithm. However, if someone is doing that up front I'm going to be pretty unhappy if they've tripled the speed of a function that only uses two percent of the total program run time. Frequently when programmers guess where the performance problems will be they guess wrong. Thus, by worrying about performance before we worry about correctness and completeness, we're more liable to build overly complicated and confusing code. What's worse, that confusing code is less likely to benefit our overall performance.

Performance is often important, but it should rarely be the first consideration. If we avoid useful (a carefully chosen word) abstractions out of fear they will slow things down, we're hurting our ability to write correct and complete code. Focus on performance after you know the code is right.

Cheers,
Ovid

New address of my CGI Course.


In reply to Re: Performance, Abstraction and HOP by Ovid
in thread Performance, Abstraction and HOP by pg

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (6)
    As of 2014-12-28 05:17 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (178 votes), past polls