From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 AC61FBBAF for ; Fri, 6 Nov 2009 16:38:33 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkACAGvR80qTIMAkmWdsb2JhbACBTZojAQEBAQEICwoHE8FEhD0EgWc X-IronPort-AV: E=Sophos;i="4.44,694,1249250400"; d="scan'208";a="49916870" Received: from max.feld.cvut.cz ([147.32.192.36]) by mail4-smtp-sop.national.inria.fr with ESMTP; 06 Nov 2009 16:38:33 +0100 Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id F00B419F343C for ; Fri, 6 Nov 2009 16:38:32 +0100 (CET) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id fjAnB66y+-fC for ; Fri, 6 Nov 2009 16:38:28 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id CDA7B19F3435 for ; Fri, 6 Nov 2009 16:38:28 +0100 (CET) Received: from localhost.fel.cvut.cz (meyer.felk.cvut.cz [147.32.84.20]) (Authenticated sender: kybicjan) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 7A1D7FA003 for ; Fri, 6 Nov 2009 16:38:28 +0100 (CET) To: caml-list@inria.fr Subject: Re: [Caml-list] Re: ATS versus Ocaml Reply-To: Jan Kybic From: Jan Kybic In-Reply-To: (Sylvain Le Gall's message of "Fri, 6 Nov 2009 12:11:43 +0000 (UTC)") References: <878wem75iq.fsf@fel.cvut.cz> <200911042025.34897.jon@ffconsultancy.com> <87y6mmc4nv.fsf@fel.cvut.cz> <200911042315.55304.jon@ffconsultancy.com> <87fx8reuvr.fsf_-_@fel.cvut.cz> Date: Fri, 06 Nov 2009 16:38:27 +0100 Message-ID: <87ljijd5os.fsf@fel.cvut.cz> User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; ocaml:01 ocaml:01 -unsafe:01 ocamlopt:01 -unsafe:01 caml-list:01 explicitly:02 slower:02 checking:02 checking:02 void:06 fel:07 fel:07 standard:07 probably:07 >I notice that in ATS you have to give the type of the array explicitly fn bubble_sort (a : array0 double ) : void = > so you should also do so in the OCaml code, using You are right, I am sorry for this omission. Having done that, the ration between Ocaml and ATS times drops to 3:1 (Ocaml being slower). >Do you know if ATS is performing array bound checking? The OCaml code is >nearly 2X faster with -unsafe than without. Yes, I think the ATS code does perform bound checking. There is probably a way to avoid it but I do not know how to do it yet. With "ocamlopt -unsafe", the ratio drops further to 2:1 > Are you using amd64 architecture ? No. Standard Intel x86. Jan -- ------------------------------------------------------------------------- Jan Kybic tel. +420 2 2435 5721 http://cmp.felk.cvut.cz/~kybic ICQ 200569450