Date: Fri, 8 Jun 2001 18:07:54 +0200 To: Jacques Garrigue Cc: luther at dpt-info.u-strasbg.fr, bombadil at wanadoo.es, debian-ocaml-maint@lists.debian.org, lablgtk@kaba.or.jp Subject: Re: lablgtk and slowness of examples Message-ID: <20010608180754.A13836 at lambda.u-strasbg.fr> References: <20010608103814.A32483 at fangorn.net> <20010608164336.A12804 at lambda.u-strasbg.fr> <20010609010109W.garrigue at kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010609010109W.garrigue at kurims.kyoto-u.ac.jp> From: Sven LUTHER Sender: Sven LUTHER On Sat, Jun 09, 2001 at 01:01:09AM +0900, Jacques Garrigue wrote: > > After some testing, you can try compiling to either bytecode or nativecode, > > and obtain a much faster start. you can do it with either : > > > > ocamlopt -I +lablgtk -labels -o testgtk.opt lablgtk.cmxa gtkInit.cmx testgtk.ml > > ocamlc -I +lablgtk -labels -o testgtk lablgtk.cma gtkInit.cmo testgtk.ml > > You should also add "-w s", to avoid all these silly warnings about the > return type being not unit. You can see it in the lablgtk script. Why not add the propper ignore (...) to the examples ?, like in : - button #connect#clicked ~callback: window#destroy; + ignore (button #connect#clicked ~callback: window#destroy); > > Either version is much faster than the toplevel one. I don't know specially > > what is different here though. > > That's very strange. Trees are built an order faster with the bytecode > compiled version rather than the toplevel one. > I also tried loading testgtk.cmo in the toplevel, and this is also > fast. > > I have no idea why it is so. I always believed that the toplevel > compiled to bytecode exactly as ocamlc, and should provide the same > speed. This is certainly not a source code interpreter. > I'll have to ask Xavier about this one. Strange indeed, ... could it be something related with the parsing issue ? Friendly, Sven Luther