realbasic-nug
[Top] [All Lists]

Re: Performance and faster idioms

To: REALbasic-NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Performance and faster idioms
From: Massimo Valle <maxduepuntozero at yahoo dot it>
Date: Mon, 28 Feb 2005 08:35:16 +0100
Delivered-to: realbasic-nug at lists dot realsoftware dot com
on 28-02-2005 1:46, Charles Yeomans wrote:


> 
> I tried this and there was essentially no difference in execution time
> on my machine; each took at most 1 tick to execute.
> 
> The real lesson here is that unless you're doing a lot of iterations,
> there is no point to worrying about the difference between If and
> Select Case.  If I had code that requires doing a million conditional
> blocks, I'd spend my time trying to refactor the code to eliminate the
> repeated testing.
> 

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

I agree with you on trying to eliminate the repeated testing, however to see
the performance we must do a repeated testing.
In real world I was able to speed up a lot a graphics drawing routine with
an if-then block in Paint event.

Massimo Valle



_______________________________________________
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>