New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nikola help is really slow #1825
Comments
Current hypothesis: Loading a bunch of plugins manully via the imp module like Yapsy does is slower than loading it via normal imports. A default installation of Nikola has ~60 modules, which means this is noticeable. |
Better hypothesis: loading 10k SLOC is really slow. |
If plugins or even loading too much code is the problem... doit plugins are loaded on demand http://pydoit.org/extending.html#plugins |
Sadly migrating now off Yapsy and to another plugin mechanism feels like a bad idea. Maybe we should special-case help so it only loads the command plugins. |
Crazy and (probably) impossible optimization idea: don’t load any plugins unless we need something from that plugin. Instead, (for help) just read the And if we do |
@tibonihoo Do you have any ideas? Is there any way to get rid of .plugin files? Or to speed things up? |
You'd need a specific pluginmanader decorator for that but it seems clearly feasible as plugin drtection and loading happens in two separate steps. Considering my current latency on my open projects like yapsy I may not be of a great help though (maybe I'll have a "window" in 1 weeks though). |
Actually looking at things with a profiler shows we can bring this down without touching yapsy:
So, ipynb and post_list plugins account for about 40% of startup time. |
We are activating compiler plugins that we should not. We are looking at COMPILERS.keys() but compiler plugins that match nothing in POSTS/PAGES should not be enabled. Merged: don't load a bunch of plugins. |
Next idea: only load the needed kind of plugins:
|
It takes about 1.5 seconds on my machine... that should be much faster.
Actions taken:
This cut down (in my admittedly fast machine) startup from 0.7 seconds to <0.3
Should be enough for this shot.
The text was updated successfully, but these errors were encountered: