Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
OCaml image blending performance
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-02-06 (20:29)
From: Ilmari Heikkinen <ilmari.heikkinen@g...>
Subject: OCaml image blending performance

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:

Or as a tarball:

tar zxf blend_test.tar.gz
cd blend_test


real	0m1.466s
user	0m1.456s
sys	0m0.008s


real	0m5.463s
user	0m5.456s
sys	0m0.012s


real	0m3.423s
user	0m3.404s
sys	0m0.012s

Use them as you wish.

Ilmari Heikkinen