Hi all, There's a bot substituting {{clear}} with the equivalent HTML: <div style="clear: both"></div>. There are several reasons I can think of why this is a bad idea: * Editors won't realise there is a simple template they can add to achieve this effect * It gives the impression that embedding raw HTML is encouraged * It possibly makes reusing Wikipedia content in non-HTML contexts more difficult * It mixes implementation details with semantic markup * It's ugly and takes more characters (particularly wrt {{-}} )
There is one reason why it's a good idea: * Transclusion is "CPU-intensive"
Can someone tell me how important this last reason is? How bad is it to transclude frequently used templates? Could it be improved? Is this going to go away? Permanently substing a large number of templates to solve a short-term performance problem is, well, bad.
Thanks, Steve
On 6/13/06, Steve Bennett stevage@gmail.com wrote:
There is one reason why it's a good idea:
- Transclusion is "CPU-intensive"
Making thousands upon thousands of utterly trivial edits is also resource intensive, but that seems to be forgotten.
On Tue, Jun 13, 2006 at 10:26:43AM +0200, Steve Bennett wrote:
Can someone tell me how important this last reason is? How bad is it to transclude frequently used templates? Could it be improved? Is this going to go away? Permanently substing a large number of templates to solve a short-term performance problem is, well, bad.
That's roughly the same argument adduced to explain why WAP sucks, and it's just as cogent here as it is there.
Never permanently "fix" performance problems by translating them out of existence; it will bite you when the machines catch up.
ObWikitech: I've Wikipediizing from my spandy used Blackberry lately.
Reading works nicely; the page layout is pretty well taken for non-CSS devices. Writing less so, though I forget precisely what broke.
Cheers, -- jra
On 6/14/06, Jay R. Ashworth jra@baylink.com wrote:
On Tue, Jun 13, 2006 at 10:26:43AM +0200, Steve Bennett wrote:
Can someone tell me how important this last reason is? How bad is it to transclude frequently used templates? Could it be improved? Is this going to go away? Permanently substing a large number of templates to solve a short-term performance problem is, well, bad.
That's roughly the same argument adduced to explain why WAP sucks, and it's just as cogent here as it is there.
Never permanently "fix" performance problems by translating them out of existence; it will bite you when the machines catch up.
So, we're still yet to hear how bad it is to have, say, 5 transcluded templates on each of, say, 50,000 not particularly popular pages. Compared to substituting them all.
Also, is it true to say that the transclusion only takes place the next time the page is modified and resaved?
Steve
Moin,
On Wednesday 14 June 2006 18:07, Steve Bennett wrote:
On 6/14/06, Jay R. Ashworth jra@baylink.com wrote:
On Tue, Jun 13, 2006 at 10:26:43AM +0200, Steve Bennett wrote:
Can someone tell me how important this last reason is? How bad is it to transclude frequently used templates? Could it be improved? Is this going to go away? Permanently substing a large number of templates to solve a short-term performance problem is, well, bad.
That's roughly the same argument adduced to explain why WAP sucks, and it's just as cogent here as it is there.
Never permanently "fix" performance problems by translating them out of existence; it will bite you when the machines catch up.
So, we're still yet to hear how bad it is to have, say, 5 transcluded templates on each of, say, 50,000 not particularly popular pages. Compared to substituting them all.
Also, is it true to say that the transclusion only takes place the next time the page is modified and resaved?
Yes. The nice things about templates is that you can do tricks like editing this page:
http://bloodgate.com/wiki/index.php?title=Template:Slides
And all the presentation slides will be updated automatically.
So, I probably missed half of the argumentation, but why is the performance problem more important than the saved human work?
best wishes,
tels
On 6/14/06, Tels nospam-abuse@bloodgate.com wrote:
So, I probably missed half of the argumentation, but why is the performance problem more important than the saved human work?
I'm not sure which human work you're talking about. The argument is that for templates which change rarely (or never), the performance hit is more important than other, mostly intangible, benefits.
Steve
On 14/06/06, Steve Bennett stevage@gmail.com wrote:
Also, is it true to say that the transclusion only takes place the next time the page is modified and resaved?
When an uncached form of the parsed markup is needed, or when the cache expires next, the entire page will be re-parsed, during which time the transclusion will be parsed as well.
An edit or purge before that time will cause invalidation of all the cached forms for that page.
Rob Church
On 6/14/06, Rob Church robchur@gmail.com wrote:
On 14/06/06, Steve Bennett stevage@gmail.com wrote:
Also, is it true to say that the transclusion only takes place the next time the page is modified and resaved?
When an uncached form of the parsed markup is needed, or when the cache expires next, the entire page will be re-parsed, during which time the transclusion will be parsed as well.
An edit or purge before that time will cause invalidation of all the cached forms for that page.
Ok, probably stupid question, but can you tell me, in the case where X transcludes Y which transcludes Z, then X changes, does Z have to be reparsed? Or is Y's cached version substituted as it is?
Also, what exactly is so slow about the transclusion? Raw inclusion of source code from another source is not typically a particularly expensive operation, when thinking of C's #INCLUDE, for example. Is it the finding of the transcluded page by name, or what?
Or could it be theoretically possible to cache page sections rather than whole pages, to reduce the risk of having to reparse the whole page, or something?
Bots going around substituting all templates wholesale just seems like such an undesirable thing if we could possibly avoid it...
Steve
On 14/06/06, Steve Bennett stevage@gmail.com wrote:
Ok, probably stupid question, but can you tell me, in the case where X transcludes Y which transcludes Z, then X changes, does Z have to be reparsed? Or is Y's cached version substituted as it is?
As far as I know, and this might have changed since I last read it, but it's all reparsed.
Also, what exactly is so slow about the transclusion? Raw inclusion of source code from another source is not typically a particularly expensive operation, when thinking of C's #INCLUDE, for example. Is it the finding of the transcluded page by name, or what?
What part of the email I sent implies it's "so slow"?
Or could it be theoretically possible to cache page sections rather than whole pages, to reduce the risk of having to reparse the whole page, or something?
I'm not sure that would provide a long term benefit.
Bots going around substituting all templates wholesale just seems like such an undesirable thing if we could possibly avoid it...
If there's no need, then don't do it. It has been stated time and time again that, when the development or system administration teams make policies, they are usually going to be software enforced. If you need something done for editorial reasons, *go ahead and do it.* It's your job to write the damn encyclopaedia, and it's our job to worry about the software and servers coping with it.
Need to transclude {{x}} into 30,000 pages? Do it. Utilise common sense and avoid changing it too much, sure; but don't act like you shouldn't actually make use of the software. That's a stupid attitude.
Rob Church
On 6/14/06, Rob Church robchur@gmail.com wrote:
Also, what exactly is so slow about the transclusion? Raw inclusion of source code from another source is not typically a particularly expensive operation, when thinking of C's #INCLUDE, for example. Is it the finding of the transcluded page by name, or what?
What part of the email I sent implies it's "so slow"?
None. However, common belief appears to be that substituting commonly used, static templates is good for performance reasons.
Or could it be theoretically possible to cache page sections rather than whole pages, to reduce the risk of having to reparse the whole page, or something?
I'm not sure that would provide a long term benefit.
No? Ok.
If there's no need, then don't do it. It has been stated time and time again that, when the development or system administration teams make policies, they are usually going to be software enforced. If you need something done for editorial reasons, *go ahead and do it.* It's your job to write the damn encyclopaedia, and it's our job to worry about the software and servers coping with it.
Need to transclude {{x}} into 30,000 pages? Do it. Utilise common sense and avoid changing it too much, sure; but don't act like you shouldn't actually make use of the software. That's a stupid attitude.
So, bots that transclude for performance reasons should be stopped? All the templates that are labelled "This template is a good candidate for subst:" should be rethought? Do you think your response represents "the developers'" opinion in general?
Steve
On 14/06/06, Steve Bennett stevage@gmail.com wrote:
On 6/14/06, Rob Church robchur@gmail.com wrote:
Also, what exactly is so slow about the transclusion? Raw inclusion of source code from another source is not typically a particularly expensive operation, when thinking of C's #INCLUDE, for example. Is it the finding of the transcluded page by name, or what?
What part of the email I sent implies it's "so slow"?
None. However, common belief appears to be that substituting commonly used, static templates is good for performance reasons.
Never underestimate the ability of humans to emulate that which goes "baa".
So, bots that transclude for performance reasons should be stopped? All the templates that are labelled "This template is a good candidate for subst:" should be rethought? Do you think your response represents "the developers'" opinion in general?
Substituting templates should be done when the template is being used as a boilerplate or in cases where, for instance, it'll never need to be changed again. Something like a vandalism warning, as an example, isn't going to need to be changed in all locations, so substituting it is more appropriate, not to mention, if it's a "testX" template, then the user can hit edit and start to understand how the site works, not be confronted with a brace substitution.
Templates as tags, et al. do need to be changed so that things are consistent, and should use regular transclusion.
I can't speak for the developers as a team. We all have our own opinions about what's "neat" and "clean" from a technical standpoint. For what it's worth, however, Brion Vibber has expressed a previous opinion that fragile editorial constructs are...fragile (spoken from the perspective of an editor, I think) and that policies shouldn't be dictated based on what people believe the server load to be.
Rob Church
On 6/15/06, Rob Church robchur@gmail.com wrote:
Substituting templates should be done when the template is being used as a boilerplate or in cases where, for instance, it'll never need to be changed again. Something like a vandalism warning, as an example, isn't going to need to be changed in all locations, so substituting it is more appropriate, not to mention, if it's a "testX" template, then the user can hit edit and start to understand how the site works, not be confronted with a brace substitution.
So, when to substitute: (in the context of en.wp) * message templates on talk pages (eg, {{welcome}}) * "boilerplate" (any examples? not quite sure what you mean) * project templates that substitute in time/date (eg, {{prod}}) * project templates that create text that should then be edited (eg, on WP:FPC)
When not to substitute: * when better site performance is the only goal
I can't speak for the developers as a team. We all have our own opinions about what's "neat" and "clean" from a technical standpoint. For what it's worth, however, Brion Vibber has expressed a previous opinion that fragile editorial constructs are...fragile (spoken from the perspective of an editor, I think) and that policies shouldn't be dictated based on what people believe the server load to be.
It occasionally happens that someone says "According to the developers, X is bad, so we should do Y". Is it best to just ignore such claims until a respectable developer actually shows up and says X is bad?
Steve
On 15/06/06, Steve Bennett stevage@gmail.com wrote:
It occasionally happens that someone says "According to the developers, X is bad, so we should do Y". Is it best to just ignore such claims until a respectable developer actually shows up and says X is bad?
IMO, if it sounds feasible, hold off or cut down on it, but attempt to check with a developer or one of the network operations staff as soon as possible.
Rob Church
wikitech-l@lists.wikimedia.org