Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Development Log
#82
GIAKEN Wrote:Another good optimization to do is convert all of the division you can into multiplication. Dark Dragon said multiplication is faster in VB.

I did: / 2 to * 0.5, / 10 to * 0.1, and / 5 to * 0.2

This is good if you require a floating-point return. For example:

Code:
4 \ 2

is faster than:

Code:
4 * 0.5

While they're both faster than:

Code:
4 / 2

These kind of optimizations are hardly worth the time and effort to change to, though, unless it is in a routine called thousands of times per frame. For example, I just made a huge optimization to vbGORE, increasing the frame rate from 40% in heavily graphical areas to over 200% in low-graphical areas, by creating a buffer of tiles, in order, that need to be drawn, and what map tile they correspond to, which prevented the needless looping of every map tile to see if theres something to draw and instead just goes through the a minimalist loop and knows theres something to draw.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)