in reply to Performance

I have a script that is using too much cpu cycles, i was wondering how i can fix this, and maybe speed up the script a bit.

Here's the basic five step plan for dealing with Performance issues:

  1. Find out where your script is spending most of its time (via profiling, putting in code to record timestamps, whatever). Go there.
  2. Look for work that you don't need to do, and don't do it.
  3. Look for work that only needs to be done once, rather than over and over and over. Do that work once.
  4. Look for less (time) expensive ways of doing whatever work is left over.
  5. Repeat steps 1-4 until performance is good enough.

Conceptually, that's it.