Skip to content
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

Reduce search_index.js file size ? #2606

Open
t-bltg opened this issue Nov 12, 2024 · 6 comments
Open

Reduce search_index.js file size ? #2606

t-bltg opened this issue Nov 12, 2024 · 6 comments

Comments

@t-bltg
Copy link
Contributor

t-bltg commented Nov 12, 2024

How can I reduce search_index.js file size ?

The gh-pages limit is 100Mb, and I'm hitting this limit e.g. https://github.com/JuliaPlots/Plots.jl/actions/runs/11794903812/job/32859378612#step:5:27591.

@mortenpi
Copy link
Member

Any ideas why it's that large? The Julia manual's index is the largest I know of and it's less than 1 MiB. I suspect some sort of auto-generated content is getting included..?

@t-bltg
Copy link
Contributor Author

t-bltg commented Nov 13, 2024

There definitively is some auto-generated content. We have a "fix" in order to reduce added search content: https://github.com/JuliaPlots/Plots.jl/blob/v2/docs/make.jl#L32-L65 (related to JuliaPlots/Plots.jl#4157), but it should be unrelated.

Here is the dev version, around 99Mb: https://github.com/JuliaPlots/PlotDocs.jl/blob/gh-pages/dev/search_index.js.

The previous stable version for [email protected] (quite old build) was only around 8.65Mb https://github.com/JuliaPlots/PlotDocs.jl/blob/gh-pages/v1.39.0/search_index.js.

This coincides with the breaking release of Documenter 1.0 if I recall.

@mortenpi
Copy link
Member

Quickly looking through the 99 MiB one, I see heaps of SVG data in there. Documenter shouldn't be adding that, so I think it's something specific to the Plots repo that is adding it. I'd suggest trying to reduce this to an MWE, to see how it's ending up in the index.

@fredrikekre
Copy link
Member

As a sidenote, perhaps this file can be gzipped? docs.julialang.org goes from 4.1M to 950K (and the plots one from 99M to 16M).

@t-bltg
Copy link
Contributor Author

t-bltg commented Nov 13, 2024

Quickly looking through the 99 MiB one, I see heaps of SVG data in there.

Yeah, it seems that the image such as the one in this exemple lands in the search_index when e.g. searching for the keyword show_empty_bins.
I'm wondering what can be done to avoid images inclusion.

As a sidenote, perhaps this file can be gzipped?

Good idea !

@t-bltg
Copy link
Contributor Author

t-bltg commented Nov 14, 2024

I've been able to reduce the file size to ~19Mb with our updated fix https://github.com/JuliaPlots/Plots.jl/blob/v2/docs/make.jl#L35-L68, which was out of sync with Documenter's code.

So the stable docs for Plots 1.40 is back.

Still, being able to remove the images from the search index might be our best bet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants