Version française
Home     About     Download     Resources     Contact us    
Browse thread
Correct way of programming a CGI script
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Correct way of programming a CGI script
On Tue, 2007-10-09 at 01:23 +0200, Arnaud Spiwack wrote:
> > And here is the Felix (C++) version:
> >
> > int i;
> > var x = "";
> > s := "a";
> > forall i in 1 upto 10_000_000 do
> >   x += s;
> > done;
> > println$ len x;
> >
> > Time: 0m0.198s
> 
> Out of curiosity, does it work as well (meaning as fast) if you write "x 
> = s+x" instead ?

I checked:

	x = x + s

and that's slow, I guess x = s + x is also slow. In Felix I would be
able to fix the x = x + s case with an imperative reduction, 
however Felix only supports functional reductions at the moment. 
[A reduction is a user defined term rewriting rule].

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net