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.9 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 019FEBC6B for ; Tue, 9 Oct 2007 07:49:56 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACuzCkfAXQImh2dsb2JhbACORgEBAQgKKQ X-IronPort-AV: E=Sophos;i="4.21,246,1188770400"; d="scan'208";a="2698518" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 09 Oct 2007 07:49:55 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l995nkoH018485 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 9 Oct 2007 07:49:55 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKOzCkdA6ba5kGdsb2JhbACORgEBAQEHBAQTEQc X-IronPort-AV: E=Sophos;i="4.21,246,1188770400"; d="scan'208";a="2543636" Received: from nf-out-0910.google.com ([64.233.182.185]) by mail1-smtp-roc.national.inria.fr with ESMTP; 09 Oct 2007 07:49:55 +0200 Received: by nf-out-0910.google.com with SMTP id g13so1218410nfb for ; Mon, 08 Oct 2007 22:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; bh=m1N58fxYFtdM/Y6USUs0JYtdxLmOhswnpZw1D4ER+xM=; b=gTblLPputb0lxGSMz4N1leHOA7qzMKK9RdPZzTf31sJUJzwBYW57WUX4/1ogjBTeerbLwPjnL8h7i+2Mvos7T7krkoP7X+bDLXtccj9Xg4407ZHmB4s9TVtQxWa9umXZPuhHbZZeTteXpJ5CMSWfSvZuQyFYaheaoOV7bwkGQhU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; b=jiS0oduMnopuNC53GodwBzpWrMZtaVHGZakzAvhsDFLQPoo13umnp3gBIhhiWC3P4k2PLSAaPCMrJlnTg9hsSi/K2FuAIdRnANURyhHc1u2sbi27JLGUEr/DEISGG80ERCt+QQWL5HKPt6qT3vqjP1LYr79o6vUTNC6Sk1t1ZQ4= Received: by 10.86.58.3 with SMTP id g3mr5735309fga.1191908994606; Mon, 08 Oct 2007 22:49:54 -0700 (PDT) Received: from ?192.168.0.1? ( [82.246.197.195]) by mx.google.com with ESMTPS id e8sm14823282muf.2007.10.08.22.49.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Oct 2007 22:49:52 -0700 (PDT) Subject: Re: [Caml-list] Correct way of programming a CGI script From: David Teller To: skaller Cc: caml-list@inria.fr In-Reply-To: <1191884703.26491.9.camel@rosella.wigram> References: <1191859489.10162.16.camel@localhost.localdomain> <1191879429.28011.27.camel@rosella.wigram> <20071009082147.657017dc.mle+ocaml@mega-nerd.com> <1191884703.26491.9.camel@rosella.wigram> Content-Type: text/plain Date: Tue, 09 Oct 2007 07:49:49 +0200 Message-Id: <1191908989.20593.6.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit Sender: David Teller X-Miltered: at discorde with ID 470B167A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ens-lyon:01 regexps:01 ocaml:01 pcre:01 outputting:01 ocaml:01 fwiw:01 cheers:01 wrote:01 wrote:01 caml-list:01 strings:01 binary:02 slower:02 shootout:02 Here, the obligatory reference to the Shootout: The two string manipulation benchmarks are http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=all (Not quite as much string manipulation as Regexps, OCaml is among the best here, but Python is about 2x faster -- I've tried improving it with PCRE but the final result is not as fast as with Str) http://shootout.alioth.debian.org/gp4/benchmark.php?test=fasta&lang=all (Not quite as much string manipulation as outputting strings, OCaml is still among the best here, and Python is about 25x slower) Fwiw. Cheers, David On Tue, 2007-10-09 at 09:05 +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: