Version française
Home     About     Download     Resources     Contact us    
Browse thread
caml: camlp4 revised syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] caml: camlp4 revised syntax
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