Forgot your password?
typodupeerror

Comment Code with performance in mind (Score 1) 269

Many of the good books have already been mentioned in other posts...

One thing to keep in mind: optimize as you go (use common sense). Here are a few examples:

  • use arrays over vectors when possible. It's a hell of a lot faster (30x - 40x on some examples).
  • sort the array if you're going to reference it a lot (people still believe in searching an array from start to end for some ungodly reason)
  • use regex to validate data (why are you parsing the input data manually? -- unless you can prove that it's faster)

A lot of little performance hit eventually adds up to a bigger performance problem. Granted, there will be large performance problem, but sloppy programming should not add to the real problems.

Slashdot Top Deals

"Your stupidity, Allen, is simply not up to par." -- Dave Mack (mack@inco.UUCP) "Yours is." -- Allen Gwinn (allen@sulaco.sigma.com), in alt.flame

Working...