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 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id A6B94BC69 for ; Tue, 25 Sep 2007 01:12:54 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAFzh90bAXQInemdsb2JhbACOGwIJCg X-IronPort-AV: E=Sophos;i="4.20,293,1186351200"; d="scan'208";a="3195976" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 25 Sep 2007 01:12:53 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l8ONCnr8031277 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 25 Sep 2007 01:12:53 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGrg90bUGyodimdsb2JhbACOGwIBCAQGDxEH X-IronPort-AV: E=Sophos;i="4.20,293,1186351200"; d="scan'208";a="16720463" Received: from smtp3-g19.free.fr ([212.27.42.29]) by mail4-smtp-sop.national.inria.fr with ESMTP; 25 Sep 2007 01:12:53 +0200 Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id A650B643B2; Tue, 25 Sep 2007 00:34:34 +0200 (CEST) Received: from [192.168.0.3] (rke75-3-82-229-183-156.fbx.proxad.net [82.229.183.156]) by smtp3-g19.free.fr (Postfix) with ESMTP id 7F0EA67FA3; Mon, 24 Sep 2007 21:56:32 +0200 (CEST) Message-ID: <46F815F2.1010903@frisch.fr> Date: Mon, 24 Sep 2007 21:54:26 +0200 From: Alain Frisch User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Bruno De Fraine Cc: Caml-list ml Subject: Re: ocamllex speed [was Re: [Caml-list] mboxlib reloaded ;-)] References: <20070427135425.GA1161@first.in-berlin.de> <20070427162911.GA10099@furbychan.cocan.org> <20070427231220.GA1507@first.in-berlin.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46F84471.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; frisch:01 frisch:01 ocamllex:01 avoided:01 compiler:01 3.5:98 0.35:98 wrote:01 compile:01 caml-list:01 alain:01 alain:01 occurrences:02 string:02 native:03 Bruno De Fraine wrote: > Neither version does anything useful, except print the current directory > when it encounters the string "current_directory". I tested this on a > 57M text file (that has only a few "current_directory" occurrences). The > ocamllex-version takes about 3.5s, while the Str-version takes only > 0.35s. What causes this difference? Perhaps there is a high overhead in > calling the translate function for every input character in such big > input files, but I don't know how this can be avoided. Did you try to compile the same programs with the native compiler? -- Alain