Code center > Darwinbots Program Source Code

The FastInvSqrt function!

<< < (2/3) > >>

Numsgil:
I was afraid of something like that...  When I was researching how to do DLLs, I found a disclaimer at the bottom of an obscure page that said something to the effect that often times its faster to use VB code because interfacing with other languages can be slow.

Anyway, I guess I have to go back and figure out how to make the speed increase real...  lol.

Notably, often times when you're taking the sqr, you then divide something by it.  So for it to be a good test, you should add a third case where you have some large number divided by the sqr, or multiplied by the invsqrt.

Greven:
I dont think it would make difference really.

Numsgil:
I don't either, not a significant one anyway...

Greven:
I have read millions of articles about optimization in VB, and calls to DLL, is on the negative side, it slows down it very very much.

Numsgil:
Well, that's one idea out the window :P

Problem is this fast function uses bit manipulations that aren't accessible in VB.  I may just go back to the old Newton iterative method, which is still fast but uses divisions...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version