-
Notifications
You must be signed in to change notification settings - Fork 21
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
Feat interlinks fast #253
Feat interlinks fast #253
Conversation
@has2k1, do you mind checking to see if this speeds up your plotnine build? I pulled the plotnine quartodoc PR and built, and it seems to cut the time down to ~3.5mins for the API docs. You should just need to add the fast option to your interlinks:
fast: true
... Then run quartodoc build
quartodoc interlinks
quarto preview The build and interlinks command should produce inventory files that are |
On my laptop build time is 10min down from 40min. I think for plotnine I have all the pieces to close this out.
All this together leaves plotnine with different interlinks code, the results would be the same though. |
Is there a way to rationalise removing Maybe an error message that prompts the user to either (or both of):
|
Just to double check, when you say it dropped from 40 minutes to 10 minutes, are you saying you ran this PR and it dropped the time to 10 minutes? If you also know the time from your custom interlinks filter that would be useful to know, too!
What version of quarto are you using? Later versions of quarto have dropped some of the time cost per render, so I wonder if the 10 minutes could be cut down by building with a pre-release |
I'm not sure I understand. Do you mind giving me an example of how to produce an error / bad behavior? Are you saying that if a user with the old lua filter sets The |
Yes this PR got the time down to 10 min. The inverted inventory (.2 above) plus the trick with the compiling and caching (.3 above) got about 7 min. This involved a single reading of JSON files once. Putting it all (1 - 4 above) together I expect the time to be about 7 min on my end. The 3 min is the difference between repeatedly creating an inventory from text files VS repeatedly loading compiled inventory.
|
I got that.
Because of the "for now", I don't think there should be a config option. The config option will be redundant soon, but it will live on much longer because it was once required! As everyone wants "fast", new What if the option to have The deeper issue is,
Effectively, the interlinking implementation is split across two projects. I think this will create a bit of confusion. It is a hard one to resolve, but here is a try.
I think that is more forward looking than the option of having all interlinks implementation in the lua-filter! |
Doing those three things (check filter version, verify compat, manage filters somehow) make a lot of sense. You've convinced me this needs to be tackled soon (as part of comprehensive, out of the box support for interlinks), but I likely won't be able to pick it up for the next week (or maybe after posit conf). I'm going to merge as is, so we can see how the new parsing does, while allowing a fallback to the old behavior. Once we reach a place where we want to remove the Opened issue on validation: #259 |
Thanks for unearthing this crazy source of slowness, and digging so deep into optimizing! |
This PR addresses #249 , by adding a "fast" mode via the
quartodoc interlinks --fast
command..txt
file, the lua filter will parse that using regexes inspired by https://github.com/bskinn/sphobjinv/blob/main/src/sphobjinv/re.pyThis should cut parse time to about 1/5th what it was. Note that the package being generated still produces a json inventory. I think we eventually should swap that out with json (and move it into
_inv
, and later the.quartodoc
scratchpad folder).