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 BB998BC6B for ; Tue, 9 Oct 2007 17:29:21 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAEs6C0fAXQImh2dsb2JhbACOSAIBCAop X-IronPort-AV: E=Sophos;i="4.21,249,1188770400"; d="scan'208";a="17758605" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 09 Oct 2007 17:29:21 +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 l99FTJJc006219 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 9 Oct 2007 17:29:21 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAFY7C0fLENaMnmdsb2JhbACOSAIBAQcEBhEY X-IronPort-AV: E=Sophos;i="4.21,249,1188770400"; d="scan'208";a="4269442" Received: from ipmail01.adl2.internode.on.net ([203.16.214.140]) by mail3-smtp-sop.national.inria.fr with ESMTP; 09 Oct 2007 17:29:19 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAEs6C0d5LCRs/2dsb2JhbAAM X-IronPort-AV: E=Sophos;i="4.21,249,1188743400"; d="scan'208";a="207107468" Received: from ppp121-44-36-108.lns10.syd7.internode.on.net (HELO [192.168.1.201]) ([121.44.36.108]) by ipmail01.adl2.internode.on.net with ESMTP; 10 Oct 2007 00:59:17 +0930 Subject: Re: [Caml-list] Correct way of programming a CGI script From: skaller To: Christophe TROESTLER Cc: caml-list@inria.fr In-Reply-To: <20071009.121527.141161439.Christophe.Troestler+ocaml@umh.ac.be> References: <1191879429.28011.27.camel@rosella.wigram> <20071009082147.657017dc.mle+ocaml@mega-nerd.com> <1191884703.26491.9.camel@rosella.wigram> <20071009.121527.141161439.Christophe.Troestler+ocaml@umh.ac.be> Content-Type: text/plain Date: Wed, 10 Oct 2007 01:29:16 +1000 Message-Id: <1191943756.5966.15.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 470B9E4F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0200,:01 christophe:01 troestler:01 ocaml:01 ocaml:01 endline:01 sourceforge:01 wrote:01 wrote:01 caml-list:01 data:02 binary:02 idiomatic:02 string:02 string:02 On Tue, 2007-10-09 at 12:15 +0200, Christophe TROESTLER wrote: > 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. Of course that's nice, but Rope isn't the standard data structure. Maybe it should be .. -- John Skaller Felix, successor to C++: http://felix.sf.net