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.2 required=5.0 tests=AWL,MAILTO_TO_SPAM_ADDR autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 37D5DBC69 for ; Mon, 16 Jul 2007 18:40:50 +0200 (CEST) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6GGenvc029497 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 16 Jul 2007 18:40:50 +0200 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1IATcd-000738-00; Mon, 16 Jul 2007 17:40:31 +0100 Date: Mon, 16 Jul 2007 17:40:31 +0100 To: tmp123@menta.net Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] caml: camlp4 revised syntax Message-ID: <20070716164031.GA26691@furbychan.cocan.org> References: <4699FB8A.2020504@menta.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4699FB8A.2020504@menta.net> User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at discorde with ID 469B9F91.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 syntax:01 0200,:01 wrote:01 integer:01 integer:01 caml-list:01 caml-list:01 caml:02 caml:02 revised:02 string:02 seems:03 character:04 jul:04 On Sun, Jul 15, 2007 at 12:48:42PM +0200, tmp123@menta.net wrote: > 1) The internal integer coding: > > It seems that an integer of value "x" is internally stored like "2x*1" ( > x shift 1 or 1 ). That is a loss of performance, not only when doing > calculations, but also, by example, when using the integer as index of a > string character, ... . Usage of native-int doesn't improves the subject. The cost is not as great as you think: http://caml.inria.fr/pub/ml-archives/caml-list/2004/07/e86a25aa6c6a6a7d08dd7eb50cfd5d52.en.html You also need to take into account the benefit of this representation in other areas (eg. the GC). Let's see you compare the performance of real programs before jumping to conclusions. Rich. -- Richard Jones Red Hat