Gnome-shell disables and enables extension in sub-optimal manner (quadratically).
This is with gnome-shell 3.26.2 on Fedora 27 (gnome-shell-3.26.2-fc27.x86_64 When looking at the call graph from _onVersionValidationChanged(): it calls reloadExtension() on every extension reloadExtension() in turn calls unloadExtension() unloadExtension in turn calls disable() on every extension. Because of the two nested loops over the extension list, the first one in _onVersionValidationChanged and the other one in unloadExtension, all the extensions are enabled and disabled O(n2) times. If you have a lot of extensions, that makes:
- login slow
- screen lock and unlock slows
- restarts slow
By changing the order in which _onVersionValidationChanged() disables and enables extensions, we can get back to linear time as the extensions are first disabled in reverse activation order, shunting the quadractic loop.