-
Notifications
You must be signed in to change notification settings - Fork 433
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
How to make ReLaXed faster ? #37
Comments
Great idea. Here are some of my thoughts and ideas:
H(M)R is typically faster (that's what we do in React and other UI frameworks). |
The |
I'm not sure that Hot Reload would make a /massive/ difference, the time spent (for me at least) is printing the PDF, not generating the HTML. Waiting until 'networkidle2' does seem to add an extra second to the PDF printing. Is this only needed if remote images/styles are being requested? If so could it be checked when creating the HTML with Cheerio and if there are any remote urls in the content, then set that option, otherwise ignore it? Avg time ins seconds:
A quick test on a .pug file containing pug syntax/markdown and scss styling: large.pug
PDF Output disabled
PDF Output enabled
PDF Output enabled (without {waitUntil: 'networkidle2'})
small.pug
PDF Output disabled
PDF Output enabled
PDF Output enabled (without {waitUntil: 'networkidle2'})
|
@benperiton awesome, that's the kind of data I am after. The question is what happens for short files. In that case, I expect the processing time to be much less, and the networkidle2 overhead increases it severalfold. |
@Zulko I've added some numbers for a small.pug file. (and a little avg table) |
Awesome, so yeah, for small pug files, going from 1.20 to 0.20 seconds would be a great improvement, almost like real-time rendering. Very useful when you are crafting a leaflet or any otherwise complex one-page document. |
Yea, there's quite a big jump! It does seem that the first run is always slower than the rest, not quite sure why that is, it does skew the average slightly but potentially some low hanging fruit to speed it up overall. |
Since v0.1.4 ReLaXed is much faster, and also gives a better breakdown of it's different rendering steps, which should make it easier to optimize particular cases in the future. Turns out that mathjax rendering was also a bottleneck so it is now optional and replaceable by the faster Katex. |
This issue is intended as general discussion research on how to improve user experience by making rendering faster while avoid partially-rendered PDF documents.
Open questions:
domContentLoaded
work better in most cases ? If that's the case, we can always let users a choice.I am wondering if other solutions would make ReLaXed faster:
page.reload()
be faster ?Any other suggestions ?
The text was updated successfully, but these errors were encountered: