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: Norman Palardy <palardyn at shaw dot ca>
Date: Mon, 28 Feb 2005 09:31:46 -0700
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <BE481D3C dot 188B1%maxduepuntozero at yahoo dot it> <235706C3-8922-11D9-83BF-000A957CB4CC at desuetude dot com> <8007de7b9acff9d58e524edf549a3379 at shaw dot ca> <02c001c51d64$3ad99400$9b00a8c0 at salvettinec>

On Feb 28, 2005, at 12:07 AM, Salvetti2 wrote:

Hi Norman,

Assume that the "case" test takes 40 cycles (for example) and the "if" test
takes 20 cycles.
Taking the ratio would give you:

40/20 = 2x

Now, consider that from the 40 cycles used by the "case" test, 10 were used by the loop overhead. The loop overhead is the same for the "if" test, then

(10+30) / (10+10) = 2x

however, the rate between the cycles wasted by the "case" and "if" blocks is
30/10 = 3x

So, it's not enough to assume that the loop overhead is the same.
You have to find the loop overhead value in order to get the right result.

Arthur Salvetti

I can do that by simply running the loop with no if or selects.
I doubt the ratio will change and that the loop overhead is actually constant between the two tests.
I'd actually be stunned if it weren't

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