Given the complexity and general fragility of the graphic stack on GNU/Linux, I would suppose this issue can come from anywhere. It may be related to the GC pauses (and the difference in GC behavior might be mainly correlated to boxing/unboxing decisions), but it may as well come from a lot of other things. Are you positive the language runtime system is the only change between your two setups ? For example, would a simple animation written in C and OCaml and F# perform differently ?
It may also be an issue with the OpenGL FFI binding (I would trust the OCaml GC more than a hairy mix of OCaml/C code binding a large library).

I have absolutely no expertise in this domain, and your initial idea may very well be correct, but still you should make sure you're really investigating the real problem, and not something completely unrelated, before going into something as specialized and difficult than runtime implementation considerations.

On Tue, Apr 26, 2011 at 9:15 PM, Peter Ronnquist <peter.ronnquist@gmail.com> wrote:
Hi all,

I have been experimenting with f# and mono on debian linux and
compared it with ocaml.
I am interested in visual presentations for example games and in my
tests f# + mono + opentk was able to make completely smooth animations
using opengl (opentk) on debian 6.0 (squeeze).

Ocaml + lablgl gives "stutters" in the animation within the period of
a couple of seconds. The animation runs smooth for a couple of seconds
and then the animation update is disturbed with the result that the
image is "teared". The tearing lasts only for a fraction of second but
is visible for a trained eye.

I suspected that the GC could be a cause for this and I tried to
manipulate the GC settings but I could not get a completely smooth
animation for a longer period of time.

This is completely acceptable for many applications but for making a
game or for the meticulous graphical applicaton user it is not ideal.

My thought is that maybe f#/mono unboxes more values than ocaml and in
this way the GC doesn't need to work as hard?

My question really is if you think it is worthwhile to investigate the
runtime system for mono and compare it with the runtime system for
ocaml to locate the differences that might influence the animation and
then even update the ocaml runtime system to use a similar strategy
as the f# runtime system?

I would be interested in this but it would be nice to first hear from
the list if this is a good idea. I also read in the Jane Street blog
(http://ocaml.janestreet.com/?q=node/89) that ocamlpro might work on
the ocaml runtime system (including unboxing).

Best Regards
Peter Ronnquist

--
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs