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=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 12E37BC6B for ; Tue, 9 Oct 2007 12:15:36 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKjxCkfAXQImh2dsb2JhbACORwEBAQgKKQ X-IronPort-AV: E=Sophos;i="4.21,248,1188770400"; d="scan'208";a="17731994" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 09 Oct 2007 12:15:35 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l99AFZBh006345 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 9 Oct 2007 12:15:35 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKjxCkfBvsFJn2dsb2JhbACORwEBAQEHBAYJCBg X-IronPort-AV: E=Sophos;i="4.21,248,1188770400"; d="scan'208";a="4241223" Received: from hedwig2.umh.ac.be (HELO hedwig1.umh.ac.be) ([193.190.193.73]) by mail3-smtp-sop.national.inria.fr with ESMTP; 09 Oct 2007 12:15:34 +0200 Received: from poincare.swapping.umh.ac.be ([10.102.100.12]) by hedwig1.umh.ac.be (8.13.6/8.13.6) with ESMTP id l99AFa0E1888268; Tue, 9 Oct 2007 12:15:36 +0200 Received: from localhost ([127.0.0.1] ident=trch) by poincare.swapping.umh.ac.be with esmtp (Exim 4.67) (envelope-from ) id 1IfC7c-0003pV-0X; Tue, 09 Oct 2007 12:15:28 +0200 Date: Tue, 09 Oct 2007 12:15:27 +0200 (CEST) Message-Id: <20071009.121527.141161439.Christophe.Troestler+ocaml@umh.ac.be> To: caml-list@inria.fr Subject: Re: [Caml-list] Correct way of programming a CGI script From: Christophe TROESTLER In-Reply-To: <1191884703.26491.9.camel@rosella.wigram> References: <1191879429.28011.27.camel@rosella.wigram> <20071009082147.657017dc.mle+ocaml@mega-nerd.com> <1191884703.26491.9.camel@rosella.wigram> X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: University of Mons-Hainaut X-Mailer: Mew version 5.2.51 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.1 (www dot roaringpenguin dot com slash mimedefang) X-Miltered: at discorde with ID 470B54C7.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 ocaml:01 endline:01 cheers:01 wrote:01 wrote:01 caml-list:01 umh:01 binary:02 idiomatic:02 string:02 On Tue, 09 Oct 2007 09:05:03 +1000, skaller wrote: > > On Tue, 2007-10-09 at 08:21 +1000, Erik de Castro Lopo wrote: > > skaller wrote: > > > While I agree that yes, it is possible to write slow code in Ocaml > > (or any other language), I suspect that idiomatic Ocaml string handling > > compiled to a binary is just as fast if not faster than Java/Perl/Python/ > > Ruby/PHP/whatever. > > Fraid not. Python eats Ocaml alive. Python: Are you sure you are comparing string manipulation and languages here? > s= "a" > x = "" > for i in xrange(0,10000000): > x = x+s > print "done" > > Time: 6 seconds. Without optimisation switched on. Time: 6.238s Without optimisation switched on. > Ocaml: let x = ref(Rope.of_string "") let s = Rope.of_string "a";; for i = 0 to 10_000_000 do x := Rope.concat2 !x s done;; print_endline "done" Time: 2.047s Without optimisation switched on. Cheers, ChriS