Version franaise
Home About Download Resources Contact us
Browse thread
The Implicit Accumulator: a design pattern using optional arguments
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Quc_Peyrot <chojin@l...>
Subject: Re: [Caml-list] The Implicit Accumulator: a design pattern using optional arguments

On Jun 28, 2007, at 2:08 PM, Jon Harrop wrote:

> On Thursday 28 June 2007 12:42:57 Joel Reymont wrote:
>> Where does the 65% speed-up come from?
>
> Good question.
>
>> Just from using match?
>
> Yes, or you can reorder the branches of the "if" statement, putting  
> the common
> branch first.
>
> My code gives:

[...]

> So it branches out of the loop when todo=0 and does one branch per  
> loop.
>
> Both of Thomas' implementations give:

[...]

> \which branches within the loop if todo<>0 and then back to the  
> start of the
> loop. So this branches twice per loop.

That is so strange! #@$!?
Can someone enlighten us?

-- 
Best Regards,
Quc