realbasic-nug
[Top] [All Lists]

Re: Performance and faster idioms

To: <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Performance and faster idioms
From: Michael Wolf <trsho at swcp dot com>
Date: Mon, 28 Feb 2005 07:30:51 -0700
Delivered-to: realbasic-nug at lists dot realsoftware dot com
> 
>> I used microseconds to calculate the timing and I continue to get
>> about 3x
>> speed on if-then. Using ticks I get larger difference: 9x
> 
> That doesn't make any sense...  Why should the timing method you use
> influence the total speed of the test code?  I would think this means
> there's something wrong with the test or the calculations somewhere.
> 
> -Thomas
Ticks are really a poor thing to use for timing checks as they are low
priority and when something is running it will keep them from firing.
Therefore you will get really flakey results, especially on a tight loop
when the processor is busy a lot of the time. Microseconds are taken from an
internal system timer and are much more accurate. Perhaps if the ticks
routine was run in a separate thread it'd be more accurate. I only use ticks
(and timers) for rough timing.

Michael

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>