Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Costly Operations - how do you determine the expense?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 18 October 1999 - 05:40 AM

How do you know how costly an operation is? In response to my last question on unit vectors, the response was that we use unit vectors to avoid costly divides, but to me it seems as though it would be equally costly if not more so to convert vectors to unit vectors using square roots. Any general help would be greatly appreciated.

thanks


Sponsor:

#2 mhkrause   Members   -  Reputation: 122

Like
Likes
Like

Posted 18 October 1999 - 05:40 AM

For that example, we don't convert to unit vectors before every single calculation, we do it once at startup, and then reuse the unit vectors. A couple squareroots once is trivial.

Generally, mathematical operations are ordered as follows, from most costly to least

FP SquareRoot
FP Divide
Integer Multiply
FP Multiply
FP Add
Integer Add, Subtract, logical operations (AND, OR, NOT, etc.)

But the PPro and above (and Pentium?) can execute integer code while it's doing the costly, long latency floating point multiplies and adds, giving these operations an effective execution time of a single cycle.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS