15 December 2010

Algorithm optimization notes

Today I was working on optimizing an alpha-beta gaming algorithm, and I found a few things along the way:
  • Object creation can be time consuming and dragging down your algorithm performance. So, think twice when object creation can be avoided.
  • When you are implementing an algorithm, the first thing is to make it work correctly, the second thing is to spot the heavy-weight routine or code sections that requires dense computation.
  • Think twice about the use of data structure. Often times it is the wrong data structure you use that slows down the program execution.

No comments: