From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.gtk,gmane.lisp.guile.devel Subject: GOOPS slowness [was: Compiling guile-gobject experiences] Date: Mon, 15 Sep 2003 20:00:40 +0200 Sender: guile-gtk-owner@sources.redhat.com Message-ID: <87fziy7wzb.fsf_-_@alice.rotty.yi.org> References: <87ptjornbn.fsf@alice.rotty.yi.org> <20030804162116.GA1217@lark> <871xulk3v7.fsf@zip.com.au> <87fziz5exr.fsf@alice.rotty.yi.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1063648750 25374 80.91.224.253 (15 Sep 2003 17:59:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 15 Sep 2003 17:59:10 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-gtk-return-842-glgg-guile-gtk=m.gmane.org@sources.redhat.com Mon Sep 15 19:59:08 2003 Return-path: Original-Received: from sources.redhat.com ([67.72.78.213]) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 19yxcy-000300-00 for ; Mon, 15 Sep 2003 19:59:08 +0200 Original-Received: (qmail 26001 invoked by alias); 15 Sep 2003 17:59:06 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Received: (qmail 25994 invoked from network); 15 Sep 2003 17:59:05 -0000 Original-Received: from unknown (HELO octopussy.utanet.at) (213.90.36.45) by sources.redhat.com with SMTP; 15 Sep 2003 17:59:05 -0000 Original-Received: from patricia.utanet.at ([213.90.36.8]) by octopussy.utanet.at with esmtp (Exim 4.12) id 19yxcu-0001kA-00; Mon, 15 Sep 2003 19:59:04 +0200 Original-Received: from dsl-154-112.utaonline.at ([62.218.154.112] helo=garibaldi) by patricia.utanet.at with esmtp (TLSv1:RC4-SHA:128) (Exim 4.12) id 19yxcs-0000RT-00; Mon, 15 Sep 2003 19:59:02 +0200 Original-Received: from alice.rhinosaur.lan ([192.168.1.3] helo=alice ident=mail) by garibaldi with esmtp (Exim 4.22) id 19yxeK-0002fB-Ta; Mon, 15 Sep 2003 20:00:32 +0200 Original-Received: from andy by alice with local (Exim 4.22) id 19yxeS-0002na-I3; Mon, 15 Sep 2003 20:00:40 +0200 Original-To: guile-gtk@sources.redhat.com In-Reply-To: <87fziz5exr.fsf@alice.rotty.yi.org> (Andreas Rottmann's message of "Sun, 14 Sep 2003 21:48:48 +0200") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) Xref: main.gmane.org gmane.lisp.guile.gtk:217 gmane.lisp.guile.devel:2799 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2799 [Cc'ed to guile-devel since this is a guile/GOOPS speed issue; Context: The new guile-gobject Guile bindings for GTK+ use GOOPS to provide an OO interface. Building this interface (at binding module load time) is painfully slow (leading to a 10 seconds total for loading the whole GTK+ binding on my machine (Athlon 900)). ] Andreas Rottmann writes: > A way to speed the binding creation up a little bit might be to move > the ability to create methods into g-wrap, since that would save us a > few scm_c_lookups for each method. I'll look into this once I'm done > with testing the above mentioned modifications. > I've now done that and have all code for method creation in one place. I did some simple benchmarking via clock() and identified the major culprits: method creation : 4.35 seconds total (1350 * 0.00322222) GF create: 3.01 seconds total (782 * 0.0038491) method add: 1.25 seconds total (1048 * 0.00119275) The values in the parenthesis are the count how often the code segment is executed and the time in seconds for each iteration. "GF create" is the following code: default_val = scm_make (scm_list_3 (scm_class_generic, name_keyword, generic_name)); "method add" is this: scm_add_method (gf, meth); Now I wonder why it takes so long to construct a generic function (the method add time is not *that* bad)... Regards, Andy -- Andreas Rottmann | Rotty@ICQ | 118634484@ICQ | a.rottmann@gmx.at http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62 Packages should build-depend on what they should build-depend.