in reply to Re^2: best way to inline code? (i.e. macro)
in thread best way to inline code? (i.e. macro)

The speed benefit I, as the programmer, am getting is already huge. I'll just tell my boss he needs a faster 'puter. He'll probably save money that way anyway.

For the disbelievers, let's do a quick numbers game. The average cost to a company for an hour of a programmer's time (salary, benefits, lights, deskspace, etc) is around $70. For a top developer, that goes up to $100/hr or more. So, for a week's work (40 hours), that costs your company $2800. Now, a quick google found that you can get a dual-core Xeon server in a base configuration for about $3k from Dell. Let's say tricking it out puts that price up to about $7k. That's 100 hours, or 2.5 weeks of work.

In general, the server your app or db is running on is not a tricked-out dual-Xeon. I've seen performance boosts of 4-10x just by moving servers. Can you provide a similar boost from 2.5 weeks of coding, especially with no new bugs and no additional maintenance burden?

Additionally, you can often get a 2-4x boost just by realigning your database. Yeah ... code optimizations are often the last refuge of the incompetent. (Bonus points to whomever can identify the source of that misquote.)


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re^3: best way to inline code? (i.e. macro)

Replies are listed 'Best First'.
Re^4: best way to inline code? (i.e. macro)
by DrHyde (Prior) on Oct 18, 2005 at 09:50 UTC
    In general, the server your app or db is running on is not a tricked-out dual-Xeon. I've seen performance boosts of 4-10x just by moving servers. Can you provide a similar boost from 2.5 weeks of coding, especially with no new bugs and no additional maintenance burden?

    I've provided 100x speed increases in perl code with just a day or two of work in the past. Never underestimate the power of the right optimisation, applied carefully.

    In the OT's case, I doubt that inlining his functions will be *quite* as productive, but it is at least worth trying, and he has, apparently, done at least some basic profiling of his code. He might be able to play tricks with his source code using the C pre-processor to fake up macros. Read perldoc perlrun's warnings about it, and I suggest running the code through cpp seperately instead of using -P.

Re^4: best way to inline code? (i.e. macro)
by spiritway (Vicar) on Oct 18, 2005 at 06:44 UTC
    code optimizations are often the last refuge of the incompetent. (Bonus points to whomever can identify the source of that misquote.)

    Samuel Johnson...

      Salvor Hardin!
Re^4: best way to inline code? (i.e. macro)
by BrowserUk (Patriarch) on Oct 18, 2005 at 10:40 UTC

    And next month it'll need a quad Xeon, and the month after that a cluster of them. And the month after that, the company will let all it's Perl programmers go and switch to using Java for performance reasons.

    Here's another misquotation for you: "Quotations are the refuge of the timid and inexpert".


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.