This is the mail archive of the guile-gtk@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GOOPS slowness [was: Compiling guile-gobject experiences]


[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 <a.rottmann@gmx.at> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]