RE: Re[4]: [GD-Windows] Performance timing
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2004-02-11 17:53:07
|
That's interesting! As others have said: the accuracy of GetTickCount() varies highly depending on your system in general, as it polls some variable that gets updated once in a while; that's why it's the fastest. For a FPS counter, it's probably accurate enough. When you run micro-benchmarks like this, 10,000 calls might not be enough. Get interrupted once by a task switch, or just network packet/mouse movement, and your measurement is off. That's why I prefer measuring the BEST sample out of many samples. That, for RDTSC, is on the order of 40 cycles, if you don't care about temporal serialization (which you typically don't). Hard to say more without more details about the benchmark, though. (I've been burned by benchmarks measuring something other than I thought they did SOOO many times it's not even funny anymore). Cheers, / h+ -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of Carl Bevil Sent: Tuesday, February 10, 2004 5:27 PM To: Simon O'Connor Subject: Re[4]: [GD-Windows] Performance timing Did that, and they have a nice utility that performs some timing tests on your machine and spits out a report (it's at http://developer.nvidia.com/object/timer_function_performance.html). The report had interesting results: ----- QueryPerformanceFrequency() freq = 0 2593560000 method 0: QueryPerfCntr..() 10000 times tot: 0 6720740 avg: 672.074000 avg time: 2.59132e-007 method 1: GetTickCount() 10000 times tot: 0 260708 avg: 26.070800 avg time: 1.00521e-008 method 2: TimeGetTime() 10000 times tot: 0 1420712 avg: 142.071200 avg time: 5.47785e-008 method 3: Pentium internal high-freq cntr() 10000 times tot: 0 840856 avg: 84.085600 avg time: 3.24209e-008 ----- I've left out the data for less than 10,000 iterations for sake of length; the averages were similar for these cases (and I ran the test a couple times with similar results). It looks like GetTickCount is the fastest, at least for this test setup on my machine. Am I reading the results wrong? I would have expected RDTSC to be the fastest. What could this mean? Is this because of the cache effects that Jon mentioned? Just curious. :-) Tbanks! Carl ------------------------------------------ Tuesday, February 10, 2004, 4:44:01 PM, you wrote: > Hi Carl, > Have a search around nVidia's developer website > (http://developer.nvidia.com), IIRC they did presentation surveying each of > the major timing methods with regard to using them to profile code and the > advantages and disadvantages plus latencies of each. ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 |