caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pal-Kristian Engstad <pal_engstad@naughtydog.com>
To: Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] OCaml image blending performance
Date: Wed, 06 Feb 2008 14:12:28 -0800	[thread overview]
Message-ID: <47AA30CC.6060405@naughtydog.com> (raw)
In-Reply-To: <854c25eb0802061229o34a6155dncca9d8492cfe6932@mail.gmail.com>

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



  reply	other threads:[~2008-02-06 22:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06 20:29 Ilmari Heikkinen
2008-02-06 22:12 ` Pal-Kristian Engstad [this message]
2008-02-06 23:30   ` [Caml-list] " Jon Harrop
2008-02-06 23:34 ` Jon Harrop
2008-02-07 11:01   ` Richard Jones
2008-02-07 11:13     ` Dominique Martinet
2008-02-07 12:29     ` Mauricio Fernandez
2008-02-07 15:04     ` Jon Harrop
     [not found] ` <854c25eb0802070607t4b2ed641xa3bc19e8384ce23@mail.gmail.com>
2008-02-07 14:10   ` Ilmari Heikkinen
2008-02-07 14:08     ` Jon Harrop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47AA30CC.6060405@naughtydog.com \
    --to=pal_engstad@naughtydog.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=ilmari.heikkinen@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).