caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* OCaml image blending performance
@ 2008-02-06 20:29 Ilmari Heikkinen
  2008-02-06 22:12 ` [Caml-list] " Pal-Kristian Engstad
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ilmari Heikkinen @ 2008-02-06 20:29 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-02-07 15:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-06 20:29 OCaml image blending performance Ilmari Heikkinen
2008-02-06 22:12 ` [Caml-list] " Pal-Kristian Engstad
2008-02-06 23:30   ` 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

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).