! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Open internal plugin lazy
Status:
RESOLVED: FIXED
Product:
Xfce4-panel

Comments

Description Nick Schermer editbugs 2006-09-13 11:06:50 CEST
Currently the panel uses g_module_open (..., 0), maybe using G_MODULE_BIND_LAZY is better and may even improve the startup speed of the panel (hardly noticeable i guess).

@ Benny, Thunar also uses | G_MODULE_BIND_LOCAL, does the panel benefit from this?
Comment 1 Nick Schermer editbugs 2006-09-13 11:07:19 CEST
Created attachment 795 
Use G_MODULE_BIND_LAZY
Comment 2 Benedikt Meurer editbugs 2006-09-13 11:29:26 CEST
Lazy loading will add overhead to each external function call, because the target will need to be resolved first. On the other hand, while loading the module, nearly no symbol table lookups will need to be done (relocations, etc. will still need to be performed).

It can make a difference if the plugin depends on "heavy" libraries. For thunar, one example is the media tags renamer, which depends on taglib, and being a C++ library symbol lookup can be somewhat expensive.

For the panel, lazy loading does not make sense, IMHO. Because as said above, that reduces the performance of function calls in the plugins, and panel plugins need to perform quite a lot of function calls during init (in contrast with thunar plugins that just register with the gtype plugin). If however the panel would load all available plugins (I doubt that it does, but I haven't checked) and use only a few of them, lazy loading would make sense.
Comment 3 Benedikt Meurer editbugs 2006-09-13 11:31:14 CEST
BTW: What would make sense however is to use G_MODULE_BIND_LOCAL, so public symbols from the plugins will not be added to the global symbol lookup table. But beware that this might cause trouble and should be checked carefully if each internal plugin still works properly (for example that's the number one reason why thunarx python bindings are still not available).
Comment 4 Jasper Huijsmans editbugs 2006-09-24 08:34:51 CEST
Ok, with revision 23199 I load plugins with G_MODULE_BIND_LOCAL. Thanks guys.

Bug #2314

Reported by:
Nick Schermer
Reported on: 2006-09-13
Last modified on: 2010-11-20

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Attachments

Use G_MODULE_BIND_LAZY (695 bytes, patch)
2006-09-13 11:07 CEST , Nick Schermer
no flags

Additional information