On Sat, Jan 31, 2009 at 5:37 PM, Alex mrzmanwiki@gmail.com wrote:
Chad wrote:
On Sat, Jan 31, 2009 at 1:28 PM, Alex mrzmanwiki@gmail.com wrote:
Domas Mituzas wrote:
So, a checklist what can be done ( simple to complex )
[ ] - Simplification of {{cite}}
Short of significant improvements to the parser or requireing people to ask Domas before editing the template, I can
[ ] - Separate cache for Cite, to avoid reparsing on minor edits, that don't involve citations. I have no idea how much this would win, but there is theoretical chance of stripping 1% or so. ;) [ ] - Offload some templates like {{cite}} to actual PHP extensions (can of worms, but, oh well, can be standardized process too)
I've actually considered something like this in the past, basically creating a Cite 2.0 extension, where all the main cite options would be in the <ref> tags themselves with pre-defined "templates" written in PHP for web citations, book citations, etc.; this would greatly reduce the amount of stuff that needs to be done using the Cite wiki-templates and run through the parser.
You would have something like:
<ref author="Foo" title="Bar" type="book">Pages 1-10</ref>
Any parameters in the ref tag would be converted to HTML output using the "book" template in the extension rather than a thousand parser functions in some meta-template, and only the content of the tag (the page numbers in this case) would have to be run through the parser, so it would also be backwards-compatible with the current templates until they can all be migrated.
The main downside to this is that it requires someone to file a Bugzilla request every time a template needs changing.
What about throwing them in MediaWiki: space, similar to editnotices? At least then they could be cached to hell and back in the message cache.
-Chad
I considered that as well, but I'm not sure how much that will actually help. Looking at
http://en.wikipedia.org/wiki/Joe%20the%20Plumber?action=purge&forceprofi...
it took 21.796 seconds to load, most of which seems be from Parser::recursiveTagParse, about 90% of that that is from Cite::referencesFormat-parse. Even if the templates themselves are heavily cached, it still has to run all the conditionals and formatting through the parser. Heavy caching might help if there's lots of refs with the same content on multiple pages, but I don't think that's very common.
-- Alex (wikipedia:en:User:Mr.Z-man)
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Throw a caching layer on top of it. Do a final expansion until final substitution at the {{cite book}} etc level. Then you've got less to recursively parse.
-Chad