Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / tips for everyone

Author
Message
White knight
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location:
Posted: 3rd Mar 2005 10:52
ok i have seen a lot of people complain about that there frame rates are slow well one way you can solve that is by updateing your video drivers (those that have agp cards make sure that your motherboard has latest agp drivers too ). you can try setting the sync rate in your program higher.and for some you can tweak your reselotion speeds up to get better refresh rates.if anyone has any other tips to give please post them for all newcomers and even the pro's too.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 4th Mar 2005 07:34 Edited at: 4th Mar 2005 07:46
Often, especially when coding, there is more than one way to "skin a cat' (poor kitties). Different functions work at different speeds. Math functions are a good example. Use a speed testing program to test functions you want to use in your code. This will help tell you which ones are fastest.

Here's a sample speed tester code that checks the speed of addition, multiplication, and exponents (squaring). Interstingly enough, i*i is much faster than i^2!



Recommendations:
1) When results are close, either consider them to be basically the same, or test several times in different orders.

2) You can use this to calculate if what you want to do will fit into your target FPS (Example: if you want 60 FPS, then Divide 1000 by 60). This will tell you how many miliseconds in between frame updates you have to play with. Remember though, some of the time is used up by drawing your graphics (which can also be calculated).

Example: ompc (on my pc, which is slow), I show it can do 100,000 multiplication calcs in 4 miliseconds. If I want a target FPS of 60, I take 1000/60 = 16.6. So, I'm using up almost 1/4th of my alotted miliseconds between each update for 100k calcs.
If I use i^2, I get 35 miliseconds to calc 100k times. This means I am using more than double the alotted 16.6 miliseconds between updates. I would probably end up with less than 25 FPS even though I want 60!

"Droids don't rip your arms off when they lose." -H. Solo

REALITY II
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Mar 2005 09:52
Also, when comparing distances, use the squared distance instead of having to use the sqrt() function.


if (A*A + B*B) <= C*C then print "within range"

"eureka" - Archimedes

Login to post a reply

Server time is: 2024-11-27 23:45:30
Your offset time is: 2024-11-27 23:45:30