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.4 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 3129DBC6C for ; Wed, 6 Feb 2008 23:15:27 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADTAqUegISwkkmdsb2JhbACQLgEBAQEHBAYHIpxN X-IronPort-AV: E=Sophos;i="4.25,314,1199660400"; d="scan'208";a="8877087" Received: from sdmx1.scea.com ([160.33.44.36]) by mail3-smtp-sop.national.inria.fr with ESMTP; 06 Feb 2008 23:15:26 +0100 Received: from edenfox.989studios.com (edenfox.989studios.com [160.33.45.60]) by sdmx1.scea.com (8.13.6/8.13.1) with ESMTP id m16MFLla018341; Wed, 6 Feb 2008 14:15:21 -0800 X-Envelope-From: X-Envelope-To: X-Envelope-To: Received: from postal1-dog.naughtydog.com (testmail.naughtydog.com [10.15.0.5]) by edenfox.989studios.com (8.13.7/8.13.7/SCEAint-1.0) with ESMTP id m16MFJiQ027610; Wed, 6 Feb 2008 14:15:19 -0800 Received: from [127.0.0.1] ([150.0.6.116]) by postal1-dog.naughtydog.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 6 Feb 2008 14:14:02 -0800 Message-ID: <47AA30CC.6060405@naughtydog.com> Date: Wed, 06 Feb 2008 14:12:28 -0800 From: Pal-Kristian Engstad Reply-To: pal_engstad@naughtydog.com User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Ilmari Heikkinen Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] OCaml image blending performance References: <854c25eb0802061229o34a6155dncca9d8492cfe6932@mail.gmail.com> In-Reply-To: <854c25eb0802061229o34a6155dncca9d8492cfe6932@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 06 Feb 2008 22:14:02.0028 (UTC) FILETIME=[9419F6C0:01C8690D] X-Scanned-By: MIMEDefang 2.48 on 160.33.44.36 X-Scanned-By: MIMEDefang 2.62 on 160.33.45.60 X-BorderEnvelope-To: X-BorderEnvelope-To: X-Spam: no; 0.00; ocaml:01 pke:01 ocaml:01 compiler:01 tarball:01 wget:01 beginner's:01 bug:01 dog:98 beginners:01 wrote:01 wrote:01 caml-list:01 caml-list:01 computation:01 If you are looking for speed, this should be done in assembly...: http://ompf.org/forum/viewtopic.php?f=11&t=494 PKE. Ilmari Heikkinen wrote: > Hi, > > I was writing some image blending operations to get to grips with OCaml, > and wrote the same code in C as well. Asking (and receiving) advice for > optimizing the code on freenode #ocaml, I was told to post the code here > as it might be an interesting compiler test. > > The C and Caml versions don't produce the same results, but should > have the same amount of computation (don't take my word for it though, > I don't know why the results differ.) > > The source files are: > http://glimr.rubyforge.org/cake/blend.ml > http://glimr.rubyforge.org/cake/blend2.ml > http://glimr.rubyforge.org/cake/blend.c > > Or as a tarball: > > wget http://glimr.rubyforge.org/cake/blend_test.tar.gz > tar zxf blend_test.tar.gz > cd blend_test > ./build.sh > > cblend > > real 0m1.466s > user 0m1.456s > sys 0m0.008s > > blend > > real 0m5.463s > user 0m5.456s > sys 0m0.012s > > blend2 > > real 0m3.423s > user 0m3.404s > sys 0m0.012s > > Use them as you wish. > > -- > Ilmari Heikkinen > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > -- Pål-Kristian Engstad (engstad@naughtydog.com), Lead Graphics & Engine Programmer, Naughty Dog, Inc., 1601 Cloverfield Blvd, 6000 North, Santa Monica, CA 90404, USA. Ph.: (310) 633-9112. "Most of us would do well to remember that there is a reason Carmack is Carmack, and we are not Carmack.", Jonathan Blow, 2/1/2006, GD Algo Mailing List