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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id EF90ABBAF for ; Fri, 6 Nov 2009 12:49:02 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMDAIOb80qTIMAkgWdsb2JhbACBT5ohAQEWJMBohD0EiAg X-IronPort-AV: E=Sophos;i="4.44,692,1249250400"; d="scan'208";a="37652281" Received: from max.feld.cvut.cz ([147.32.192.36]) by mail3-smtp-sop.national.inria.fr with ESMTP; 06 Nov 2009 12:49:02 +0100 Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id C6A2619F33C9; Fri, 6 Nov 2009 12:49:01 +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 ymGHBuYGniYu; Fri, 6 Nov 2009 12:48:57 +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 92A6D19F338F; Fri, 6 Nov 2009 12:48:57 +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 10E55FA003; Fri, 6 Nov 2009 12:48:57 +0100 (CET) To: Jon Harrop Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] ATS versus Ocaml Reply-To: Jan Kybic From: Jan Kybic In-Reply-To: <200911042315.55304.jon@ffconsultancy.com> (Jon Harrop's message of "Wed, 4 Nov 2009 23:15:55 +0000") References: <878wem75iq.fsf@fel.cvut.cz> <200911042025.34897.jon@ffconsultancy.com> <87y6mmc4nv.fsf@fel.cvut.cz> <200911042315.55304.jon@ffconsultancy.com> User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (gnu/linux) Date: Fri, 06 Nov 2009 12:48:56 +0100 Message-ID: <87fx8reuvr.fsf_-_@fel.cvut.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; ocaml:01 allocating:01 ocaml:01 allocations:01 2009:98 wrote:01 caml-list:01 implemented:02 seems:03 preliminary:03 crashes:03 ugly:04 i'd:06 context:06 fel:07 > On Wednesday 04 November 2009 22:21:24 Jan Kybic wrote: >> > and crashes rather than performance. Moreover, I would note that the >> > performant ATS code out there seems to go to *great* lengths to avoid the >> > GC whenever possible, so I suspect it is extremely slow in the context of >> > heavily allocating code or many short-lived values (much like HLVM). For >> >> This will be easy to test. > > I'd like to know what you find in this respect. Here are my preliminary results. Please note that I am a beginner in ATS so my ATS code is rather ugly. But it is a more or less direct translation from Ocaml. I imagine the ATS results can be improved. I have asked at the ATS list about that. I have implemented two benchmarks: - eight queens, I actually used ten. I believe the original Ocaml implementation was probably yours. It uses lists as a primary structure, so there is a lot of allocations. On this task, ATS needs about 50% more time than Ocaml. - bubble sort on an array of doubles. Here ATS is more than 10 times faster than Ocaml (for n=10000). My code can be found at http://cmp.felk.cvut.cz/~kybic/share/ats_tests.zip Jan -- ------------------------------------------------------------------------- Jan Kybic tel. +420 2 2435 5721 http://cmp.felk.cvut.cz/~kybic ICQ 200569450