Re: Should we wrap accessors for properties?



On Mon, 2008-08-11 at 14:05 +0200, Torsten Schoenfeld wrote:

* A slight speed disadvantage of using the generic mechanism compared to
specialized accessors.

not so slight:

  http://bugzilla.gnome.org/show_bug.cgi?id=536939

  g_object_set is twice as slow as setting something directly and
  calling g_object_notify

  g_object_get is around 15 times slower as returning the value
  directly.

also: some classes doing direct assignments instead of implicitly
calling the setter do not call g_object_notify() inside the
set_property(), which would cause every callback attached to
the ::notify signal not to be invoked; might be fixable, might not be.

I'd rather keep the wrappers; yes, they are tedious to bind and to
maintain (deprecations and all), but the downsides are all outside the
perl bindings to solve, and cannot be really solved without some degree
of manual tweaking - which would kind of defeat the point of run-time
properties access.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]