trustin / sphinx-gradle-plugin

Sphinx site generation plugin for Gradle
https://trustin.github.io/sphinx-gradle-plugin/
Apache License 2.0
18 stars 7 forks source link

Very slow #8

Closed xtianus closed 6 years ago

xtianus commented 6 years ago

Running the gradle plugin on an empty project (the default from the tutorial) is very slow compared to the official make file. Can this be improved?

trustin commented 6 years ago

I tried hard to improve the startup time of Sphinx but most attempts ended up with failure. The main bottleneck is Jython and it takes quite a bit of time for loading various modules.

trustin commented 6 years ago

We may want to switch to the official Python interpreter using https://github.com/pantsbuild/pex or something similar, but never tried yet.

trustin commented 6 years ago

Just released sphinx-gradle-plugin-2.0.0 which should reduce the build time significantly. Could you let me know if the new release helps you as well?

trustin commented 6 years ago

Just released 2.0.2 with some fixes.

trustin commented 6 years ago

According to my test, a project that took 50 seconds to generate now takes only 12 seconds. Please open a new issue if you still have performance issues after upgrading.

xtianus commented 6 years ago

I wanted to quickly check the speed improvement but I got this error: AttributeError: module 'sphinx_bootstrap_theme' has no attribute 'get_html_theme_path' It might be my mistake though. I'm in a rush right now.

trustin commented 6 years ago

That's interesting. Are you using sphinx_bootstrap_theme in your project? If so, could you try with the default theme? If not, could you share your project so I can reproduce?

trustin commented 6 years ago

I guess it will just work if you remove the following line from your conf.py:

html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()

Sphinx will find the theme just fine without that statement.

trustin commented 6 years ago

Actually, it seems not to be the case for sphinx_bootstrap_theme. I didn't notice this issue because I was using sphinx_rtd_theme, which works just fine without html_theme_path. Until I fix this issue properly, could you try using sphinx_rtd_theme to see if the problem goes away?

trustin commented 6 years ago

Just released sphinx-gradle-plugin 2.2.0 which should fix this problem. Could you please give it a try?

xtianus commented 6 years ago

I confirm that it works and it's quick! The compilation time went down from 31s to 4s (I don't have many files). Thank you.

trustin commented 6 years ago

Very nice. :-) Would you mind letting me know your environment? e.g OS, Disk type (HDD/SSD), ..

xtianus commented 6 years ago

Windows 10, Intel i7-7500U, 16GB RAM, Samsung SSD

trustin commented 6 years ago

Cool. I was somewhat worried about Windows performance because Windows tends to be slower than *nix OSes in terms of temporary file creation.