barnowl/barnowl — pull request #91 by davidben (2012-03-14 17:12:29+00:00)
Title: Load Jabber module lazily

We have a ton of modules, and they currently cost us quite a bit in both startup and memory. (Go stick a return in `BarnOwl::ModuleLoader::load_all` and see what happens. It's pretty shocking.) It would be probably good to load the modules on-demand in some way. Exactly how, I don't know. Here's an idea for just doing it within each module. We could also do it at the module-loading layer instead. Breaking everyone's `.owl/startup` if we require you to explicitly `load-module Jabber` before `jabberlogin` even exists may or may not be okay, I dunno. There's also just additional UI complexity if you require users to explicitly load the module. If we load them on demand, we're going to have to change all the modules anyway to export their commands another way or something. On the other hand, doing it at the module-loading layer is probably less logic we have to duplicate.

My completely unscientific testing suggests the next biggest offenders are the Facebook and Twitter modules. I believe they both have some autologin feature, which might also be affected by something like this? IRC is also noticeable, but not as huge.