GNOME Bugzilla – Bug 115289
Speed up Yelp transformations
Last modified: 2004-12-22 21:47:04 UTC
After tinkering quite a bit, I discovered that generating the Previous and Next links on each chunk constitutes 70%-90% of the total transformation time. There's not a whole lot that can be done about this in XSLT, as XSLT is not designed to be optimized. However, Yelp knows what the previous and next links are from the ScrollKeeper TOC files. I'm attaching a patch that makes Yelp find the Previous and Next links from ScrollKeeper, and insert the HTML into the document when it presents it. Taking this out of the XSLT results in significant speed improvements. On my machine (an 850 MHz), the System Administrator's guide went from ~16sec to ~4sec, and the AisleRiot Manual went from a whopping ~40sec to ~4sec.
Created attachment 17553 [details] [review] Do prev/next linking in C instead of XSLT.
I should also mention that this patch puts 'About This Document' and 'Contents' in the sidebar. Doing this keeps the prev/next stuff from having to do a bunch of special case stuff. I've always wanted them in the sidebar anyway.
Adding PATCH and perf keywords and marking priority->high because of the patch.
This patch breaks the navigation links (Previous, Next, Contents) when the help document is not registered with Scrollkeeper. The navigation links are not displayed by Yelp when the document is not registered with Scrollkeeper. I would like to see this patch improved so it doesn't break the navigation links in documents not registered with scrollkeeper.
Attaching an improved patch that falls back to creating the links in XSLT when the document isn't in ScrollKeeper.
Created attachment 17591 [details] [review] Create prev/next in C, but fall back to XSLT when not in SK.
I like the patch a lot now. You can really see the difference when you use the URI to view the doc (using a different location than where Scrollkeeper expects) or when you view the same doc in Yelp.
Attaching yet another, even more improved version. This patch improves the prev/next stuff in the stylesheets, speeding up the case where the document is not in SK. To recap: Without any of these patches, AisleRiot takes 40 sec on my machine. With the patch I'm about to submit, if AisleRiot is in SK, it takes 4 sec. If it is not in SK, it takes 20 sec.
Created attachment 17628 [details] [review] Create navbar in C, fall back to XSLT if not in SK, and improve the XSLT navbar code.
I will take a look at this as soon as possible (hopefully today or tomorrow).
Shaun, I'm terribly sorry I haven't looked at this until now and now I the stylesheet doesn't apply cleanly. Do you have an updated version of this patch? If so I'll take a look at this today/tomorrow. Looks like an awesome patch from the timings listed here.
Attaching an updated version.
Created attachment 19278 [details] [review] Generate navigation links in C
Shouldn't the "Usage: " messages also be marked for translation?
This went in on HEAD, and it very likely won't even matter with the new XSLT. Closing.