Closed mirkobunse closed 4 years ago
Update: I also checked @time using PGFPlots
:
julia | loading time without this PR | and with this PR |
---|---|---|
v1.3 | 15.9 seconds | 9.7 seconds |
v1.5 | 10.4 seconds | 8.9 seconds |
An alternative to this PR could be to set up a MinimalPoppler_jll
which only offers pdftocairo
and omits the other functionality that slows down loading Poppler_jll
. Would make multiple backends completely unnecessary. Might be worth a discussion in the Yggdrasil repository.
This looks great! Thank you for your contribution!
Sure, you're welcome!
Still, I think extending the .travis.yml
to test on Mac and Windows would be great. Do you know someone who can do this?
I don't. I wanted to be able to do this for a while, but hadn't had luck. Fortunately, my PhD students use a mixture of Windows/Mac/Linux, and so they should be able to identify a potential issue---but it would be nice to have this part of travis.
Beautiful, feel free to mark me in any such issue.
In the meantime, I found out that my other suggestion, to spin up a MinimalPoppler_jll
, would likely not improve the loading time much. Fortunately, we can hope for a massive improvement in julia-1.6
. See https://github.com/JuliaPackaging/Yggdrasil/pull/908#issuecomment-676492382
If Poppler_jll
is fast in 1.6, we can easily change the default SVG backend accordingly.
I'm so looking forward to 1.6. ;-)
You mean this bit fast?
julia> @time using Poppler_jll
0.000157 seconds (102 allocations: 11.688 KiB)
while, still not optimal (maybe you need to check on brand-new master and/or check/fix invalidations)
julia> @time using PGFPlots
5.708749 seconds (7.53 M allocations: 504.851 MiB, 3.49% gc time, 21.08% compilation time)
That looks pretty fast to me! ;-)
SVGs can now be produced with multiple backends:
Poppler_jll
lately was the default. It works on all platforms, but requiresjulia-1.3
and is slow to load.pdf2svg
was the former default. The user has to have this library installed.dvisvgm
always was the fall-back solution iftikzUsePoppler()
ortikzusePDF2SVG()
was explicitly set tofalse
by the user.The original code for the
dvisvgm
fallback was somehow broken; I fixed it when implementing this PR.Providing different backends has the advantage of (potentially) faster loading times that do not loose compatibility across platforms. We have already discussed the slow loading times and potential solutions: https://github.com/JuliaTeX/PGFPlots.jl/issues/130
using TikzPictures
now checks whetherpdf2svg
is installed. If so, it uses the corresponding backend and the package loads quickly. Ifpdf2svg
is not installed, the package usesPoppler_jll
instead, which results in a longer loading time. Thedvisvgm
backend is only used if explicitly set by the user. An open point of discussion is whetherPoppler_jll
should have precedence overdvisvgm
in this sense.Loading times
pdf2svg
is already installed on my local machine, so loadingTikzPictures.jl
will be fast there. I can set the backend to poppler manually, afterwards, to see what loadingPoppler_jll
does. I tried this with julia v1.3 and v1.5, the last of which has improved loading*_jll
packages a lot.@time using TikzPictures
@time svgBackend(PopplerBackend())
Testing
Travis CI is testing PR currently on julia v1.0 (yes, it works again), v1.3, and v1.5. The only platform, however, is Linux.
Poppler_jll
should work everywhere, but I have not yet figured out how to tell Travis to install texlive etc on Mac OS and Windows. Any improvement of the.travis.yml
in this direction is warmly welcome!