From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 16CF9BC69 for ; Sun, 27 May 2007 16:53:07 +0200 (CEST) Received: from jackfruit.srv.cs.cmu.edu (JACKFRUIT.SRV.CS.CMU.EDU [128.2.201.16]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4REr5OH020425 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 27 May 2007 16:53:06 +0200 Received: from stratocaster.home (pool-70-17-170-196.pitt.east.verizon.net [70.17.170.196]) (authenticated bits=0) by jackfruit.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id l4REr3iF013359 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Sun, 27 May 2007 10:53:04 -0400 (EDT) Received: from ecc by stratocaster.home with local (Exim 4.63) (envelope-from ) id 1HsK6t-0006af-RT; Sun, 27 May 2007 10:52:43 -0400 Date: Sun, 27 May 2007 10:52:43 -0400 To: caml-list@yquem.inria.fr, lista OCaml Subject: Re: [Caml-list] A small footprint GUI for OCaml Message-ID: <20070527145243.GB25025@stratocaster.home> Mail-Followup-To: caml-list@yquem.inria.fr, lista OCaml References: <20070526220943.45293.qmail@web51612.mail.re2.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070526220943.45293.qmail@web51612.mail.re2.yahoo.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Eric Cooper X-Miltered: at discorde with ID 46599B51.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 cmxa:01 ocaml:01 strace:01 emacs:01 26,:98 continually:98 wrote:01 wrote:01 caml-list:01 usable:01 data:02 graphics:02 graphics:02 gui:04 On Sat, May 26, 2007 at 03:09:43PM -0700, Alexsandro Soares wrote: > My collaborators and I wrote a small footprint graphics.cmxa based > GUI for OCaml. It works well on Windows, but not so well on > Linux. In fact, in most Linux installations the program turns out to > be unbearably slow; to make it usable, I am forced to use powerful > and well tuned video cards. I tried your program briefly and noticed (using a load monitor) that it was constantly using CPU cycles even when it should be idle. So I ran it under "strace" and saw that it was continually reading data from the connection to the X server. This occurs inside a signal action, probably triggered by a timer interrupt. Compare that to a real Emacs process, which is almost always in a blocking select() system call when idle. I haven't looked at your source code, or the Graphics implementation, but I conclude that you need to find a way to block, rather than poll, for input events. -- Eric Cooper e c c @ c m u . e d u