Cezary Kaliszyk [Tuesday 5 November 2002] :
> On Tue, Nov 05, 2002 at 05:40:04PM +0100, Luc Mazardo wrote:
> > We are pleased to announce the 0.6 release of OCamlSDL.
> > This release provides full SDL (Simple Direct Layer) support
> > (mouse, joystick, cdrom, keyboard event, video and audio bindings).
> For some time I've seen sdlvideo2 in the cvs and was looking forward to
> using it.
> But when I tried to test it i've seen that something seemed to be buggy.
> But now in OCamlSDL 0.6 it works the same. Is 0.6 unstable?
Well, it doesn't crash randomly, so it's kind of stable.
> The problem is:
> I have 10000 sprites, which move, each one pixel per frame. With 0.5
> (or sdlvideo.ml from cvs) they move smoothly.
OK. I never tried to do so many blits at the same time.
> But in 0.6 All move about 20 pixels (20 frames) and then all pause for
> about a second. And again they move and stop. I think it is
> garbage-collection based, but I really don't know much about GC and self
> deallocating things...
It could be, but in your code the loop and iterator functions
shouldn't trigger the GC, so it may be something else.
> I include my test, if you'd like to see yourself...
Thanks. I'll disable automatic garbage collecting of surfaces and see
if it helps.
On my box, with release 0.6
$ time ./a.opt
./a.opt 5.64s user 0.11s system 49% cpu 11.634 total
$ time ./a.test
./a.test 6.18s user 0.09s system 51% cpu 12.069 total
extract of my cpuinfo:
model name : Pentium III (Coppermine)
cpu MHz : 997.584
There is no pause for the garbage collecting surface.
> > But when I tried to test it i've seen that something seemed to be buggy.
> > But now in OCamlSDL 0.6 it works the same. Is 0.6 unstable?
For the record, Cezary's programs weren't linked with the same SDL
library, hence the observed differences. So, there's nothing wrong
with ocamlsdl 0.6.