Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Performance Audit 2017: Breakup plugin creation / initialization to avoid long tasks #165
While this initialization work is generally pretty quick, it's all done as one sequential block of execution:
Here's a breakdown of
We will investigate ways of reducing the initialization cost in specific plugins, but in general, it might be nice to break up the cost of plugin creation and initialization via something like a
This could help avoiding Long Tasks on older browsers and less-powerful devices.
This might be something I've been pondering in the past, specifically when it came to onboarding new developers/users to the project/tool. As it's not always obvious from the outside how each plugin is intertwined with another it may be beneficial to draw or create dependency trees of some sort based on the plugins/instances each of the plugins will need. This way even if a plugin is required for another to work we can defer loading that plugin until it's dependencies are met.
So for example
And in BOOMR.init() we'd check which other plugins required
As a callback of some sort.