From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p3QKGWw7010023 for ; Tue, 26 Apr 2011 22:16:32 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AssBAGsnt03RVdo2mGdsb2JhbAClXQgUAQEBAQEICQ0HFCWIcKI8iniCJ4VENIheAQEDBoVwBI5Bihc6g1E X-IronPort-AV: E=Sophos;i="4.64,270,1301868000"; d="scan'208";a="93891751" Received: from mail-yi0-f54.google.com ([209.85.218.54]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 26 Apr 2011 22:16:27 +0200 Received: by yie12 with SMTP id 12so586608yie.27 for ; Tue, 26 Apr 2011 13:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ukWB4ggTFYB53Gc24m0Ud+XTWbdXI5lmCrA9Nb9I7L0=; b=a8V7zY/2tsZokMKMW+m+X9j2mO5CNGMa8dCkqqufgmQdiGBiSPGlPIbWAGa8Hm/ENu /tZrelqp/zD17qRkryhZItFlqx3uwMJb7dcc79I3L9KQQll1lFHLutbhU8kyvrFAzleS jUvmcBTr9Fc8/UeWrEr7bvptkVUUd9ELygmaA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=tytQl3A95eF3JQDqvBe9tPXvv1s9o55aQaegBQs7PLgmWaPslrtLOVQ5inNEs2xX8G fsLQGVBdlbKAyTEJQPI5X6htBJWXKcUUaFYWn0FCBBwRU2okfyxUWjQ7mLbv0KQyCF0r vqP+IzpSIByob1qEd4ZbsWZAozICUe3+GousY= MIME-Version: 1.0 Received: by 10.101.39.9 with SMTP id r9mr754808anj.147.1303848985826; Tue, 26 Apr 2011 13:16:25 -0700 (PDT) Received: by 10.100.10.1 with HTTP; Tue, 26 Apr 2011 13:16:25 -0700 (PDT) In-Reply-To: References: Date: Tue, 26 Apr 2011 22:16:25 +0200 Message-ID: From: Peter Ronnquist To: Gabriel Scherer Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Validation-by: peter.ronnquist@gmail.com Subject: Re: [Caml-list] f#/mono vs ocaml runtime system - open gl animation screen tearing. > 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 should add that the ocaml program is using sdl for setting up the initial window and for syncing with the screen update. When using C and sdl or using f# and opentk then the update of the screen is completely smooth. I'm comparing simple animations. For ocaml it is a moving rectangle, in f# it is a rotating and zooming rectangle. I have not thought about that it could be an issue with the OpenGL or SDL binding although I still tend suspect that it is the GC/runtime that interferes with the vertical blank synchronization. Using glut (no sdl) and open gl gives a very visible "stuttering" both with C and with ocaml but when using SDL and C then the result is smooth animation. My initial thinking was that it should be theoretically possible to have smooth animation when using sdl and ocaml. When I tried it and saw the occasional "stutters" my conclusion was that ocamls GC interfere with the animation. Then I tried f# and mono and realized that it is possible to have a GC that does not interfere with the animation hence I began to experiment with the GC configuration in ocaml without success. Lastly I was thinking that it might be something else than the GC and by the discussion here on the list and elsewhere it seems like the unboxing management is one other difference between ocaml and f#/mono.