From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id D0C21BC6B for ; Thu, 28 Jun 2007 15:10:13 +0200 (CEST) Received: from smtp2f.orange.fr (smtp2f.orange.fr [80.12.242.151]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5SDADKt031695 for ; Thu, 28 Jun 2007 15:10:13 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2f09.orange.fr (SMTP Server) with ESMTP id 2629A700009D for ; Thu, 28 Jun 2007 15:10:13 +0200 (CEST) Received: from [192.168.1.162] (ALagny-153-1-72-1.w90-3.abo.wanadoo.fr [90.3.39.1]) by mwinf2f09.orange.fr (SMTP Server) with ESMTP id EC1CA700008D; Thu, 28 Jun 2007 15:10:12 +0200 (CEST) X-ME-UUID: 20070628131012967.EC1CA700008D@mwinf2f09.orange.fr In-Reply-To: <200706281308.13958.jon@ffconsultancy.com> References: <200706271314.35134.jon@ffconsultancy.com> <200706281232.01643.jon@ffconsultancy.com> <58DA3107-BFD2-4ADF-A903-2CB63C6D29C2@gmail.com> <200706281308.13958.jon@ffconsultancy.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <70216A52-8710-4000-8F69-CE1D67AC54F7@lrde.epita.fr> Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: quoted-printable From: =?ISO-8859-1?Q?Qu=F4c_Peyrot?= Subject: Re: [Caml-list] The Implicit Accumulator: a design pattern using optional arguments Date: Thu, 28 Jun 2007 15:10:11 +0200 To: Jon Harrop X-Mailer: Apple Mail (2.752.2) X-Miltered: at concorde with ID 4683B335.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lrde:01 28,:98 2007,:98 wrote:01 wrote:01 caml-list:01 reorder:02 match:02 implicit:03 pattern:04 enlighten:04 65%:95 accumulator:05 branches:06 branches:06 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 =20= > the common > branch first. > > My code gives: [...] > So it branches out of the loop when todo=3D0 and does one branch per =20= > loop. > > Both of Thomas' implementations give: [...] > \which branches within the loop if todo<>0 and then back to the =20 > start of the > loop. So this branches twice per loop. That is so strange! #@$!? Can someone enlighten us? --=20 Best Regards, Qu=F4c