Repost with better formatting:
I am in the process of upgrading my Mediawiki parser for TomeRaider files, adding conditional template processing, and I also noticed how complicated templates can become
Here is an example:
For article fr.wikipedia.org/wiki/Paris the following templates were executed:
#expr: 294 #if: 100 #ifexpr: 350
After disabling geohack code, which yields two numbers only (longitude and latitude): #expr: 2 #if: 88 #ifexpr: 2
Also what happens when a switch stateent has hundreds of clauses, each with new sub-templates: are these all resolved before resolving the switch? Just wondering.
Erik Zachte
-----------------
Domas: We had some slowness today, where after some temporary issue cluster ended up spending >50% of it's time working on Spanish wikipedia template. We nuked the template (es.wikipedia site was also turned off at some moment), so now it is all up and running.
The template was used for adding a single line of text, though it took 20 seconds to render. ;-)
We'll probably have to do something about that.
On Tue, 09 Jan 2007 22:03:30 +0100, Erik Zachte wrote:
Repost with better formatting:
Also what happens when a switch stateent has hundreds of clauses, each with new sub-templates: are these all resolved before resolving the switch? Just wondering.
I believe they are resolved going in, then discarded. I experimented with using a magic word to defer evaluation (i.e. {{defer:template}}) but haven't had a chance to finish it or get any opinions on it. But there is a note on bug #8314
Just an update on the issue - it appears Spanish users took the template from Italians. Though on it.wikipedia it runs in ~1s, it runs 20s on Spanish, so obviously, just "taking teh template" didn't work that well.
We're further looking (and enjoying) the problem.
Cheers, Domas
Domas Mituzas wrote:
Just an update on the issue - it appears Spanish users took the template from Italians. Though on it.wikipedia it runs in ~1s, it runs 20s on Spanish, so obviously, just "taking teh template" didn't work that well.
We're further looking (and enjoying) the problem.
Cheers, Domas
Are the Italians still using their version? Would it perhaps be wise to advise them not to, to avoid future problems? :)
-Gurch
Hi!
Are the Italians still using their version? Would it perhaps be wise to
advise them not to, to avoid future problems? :)
Some of discussions so far (I'm not that much of an expert of wiki templates, and my eyes start bleeding when I read them):
<Splarka> hmm, the calls on {{Interproyecto/leeParametro}} on es were a lot more messy than {{Interprogetto/leggiParametro}} on it.wp... <domas> yay, we have someone who actually understands templates <Splarka> on itwp it just passed one parameter each time... <domas> splarka: feel free to write your analysis to wikitech-l <Werdna> done. <Werdna> I'm also doing some optimisation in Parser.php <Werdna> to convert one query per template to one query per cascade-protected page. <Splarka> but the es version uses 6 or 7 parameters <NotACat> Splarka: could you paste the code for those templates to http://tools.wikimedia.de/~xyrael/pastebin do you think? unless they're on a wiki somewhere, obviously;-) <Splarka> which include 2 magicwords, 1 parserfunction, and 5 or 6 parameter defaultings <Splarka> NotACat: <Splarka> http://es.wikipedia.org/w/index.php?title=Plantilla:Interproyecto/leeParamet... <Splarka> http://it.wikipedia.org/w/index.php?title=Template:Interprogetto/leggiParame... <Splarka> a typical call to each: <Splarka> -->{{Interproyecto/leeParametro|nolink={{{1}}}|{{{1|}}}|{{{nombre|{{FULLPAGENAME}}}}}|{{{{{{1}}}_idioma|{{{idioma|}}}}}}|{{{{{{1}}}_etiqueta|{{{etiqueta|{{PAGENAME}}}}}}}}|{{#ifeq:{{{1|}}}|no*||*}}|{{{{{{1}}}_objeto|}}}|{{{{{{1}}}_preposicion|{{{preposicion|}}}}}}}}<!-- <Splarka> -->{{Interprogetto/leggiParametro|{{{1|}}}}}<!-- <Splarka> I have a feeling that might be the difference <Splarka> domas: I avoid wikimedia email lists like the plague they are, sorry ^_^
So, for the record and for the plague, read above ;-)
Domas
On 10/01/07, Domas Mituzas midom.lists@gmail.com wrote:
Just an update on the issue - it appears Spanish users took the template from Italians. Though on it.wikipedia it runs in ~1s, it runs 20s on Spanish, so obviously, just "taking teh template" didn't work that well.
Obviously, with the fantastically stupid^Wcreative things people are doing with templates, we need to write a Template Virtual Machine just for running templates. Or design a mask for a FPGA that will execute template code directly in the hardware. Also, Visual Basic for MediaWiki needs to be implemented. Don't forget the BUFFEROVERFLOW() function for full Windows compatibility.
- d.
David Gerard wrote:
On 10/01/07, Domas Mituzas midom.lists@gmail.com wrote:
Just an update on the issue - it appears Spanish users took the template from Italians. Though on it.wikipedia it runs in ~1s, it runs 20s on Spanish, so obviously, just "taking teh template" didn't work that well.
Obviously, with the fantastically stupid^Wcreative things people are doing with templates, we need to write a Template Virtual Machine just for running templates. Or design a mask for a FPGA that will execute template code directly in the hardware. Also, Visual Basic for MediaWiki needs to be implemented. Don't forget the BUFFEROVERFLOW() function for full Windows compatibility.
- d.
Meh, just expose all PHP functions directly. What could possibly go wrong? :)
-Gurch
On 10/01/07, David Gerard dgerard@gmail.com wrote:
template code directly in the hardware. Also, Visual Basic for MediaWiki needs to be implemented.
You wash out your mouth with bleach this instant.
Rob Church
On 10/01/07, Rob Church robchur@gmail.com wrote:
On 10/01/07, David Gerard dgerard@gmail.com wrote:
template code directly in the hardware. Also, Visual Basic for MediaWiki needs to be implemented.
You wash out your mouth with bleach this instant.
But it is merely a simple matter of programming!
It would also be good if trusted users (say, anyone whose login is over four days old) could run SQL directly on the en: database. I have a few outer joins I really really need to check.
- d.
On 10/01/07, David Gerard dgerard@gmail.com wrote:
It would also be good if trusted users (say, anyone whose login is over four days old) could run SQL directly on the en: database. I have a few outer joins I really really need to check.
In an ideal world, you could use the toolserver for it.
The problem with trusting people to run even select queries on the English Wikipedia database is that trust does not equal sufficient SQL ability to write queries which do not suck up all our time, even with Tim's natty timeout script.
Rob Church
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Rob Church wrote:
On 10/01/07, David Gerard dgerard@gmail.com wrote:
It would also be good if trusted users (say, anyone whose login is over four days old) could run SQL directly on the en: database. I have a few outer joins I really really need to check.
In an ideal world, you could use the toolserver for it.
The problem with trusting people to run even select queries on the English Wikipedia database is that trust does not equal sufficient SQL ability to write queries which do not suck up all our time, even with Tim's natty timeout script.
Rob may be too young to remember, but back when dinosaurs ruled the earth we used to have [[Special:Asksql]] where anyone could run read-only queries on the wiki database.
Then... only sysops.
Then... only developers.
Then... we took it out entirely and run things directly on the database when we need to.
Getting the toolserver was *super awesome* because it lets people run those fun queries and grind *someone else's server* into little metallic flakes instead of the production machines. :)
- -- brion vibber (brion @ pobox.com / brion @ wikimedia.org)
On 10/01/07, Brion Vibber brion@pobox.com wrote:
Rob may be too young to remember, but back when dinosaurs ruled the earth we used to have [[Special:Asksql]] where anyone could run read-only queries on the wiki database.
I know we had it (we still have the code), but I don't think I was around when it was active.
Then... only sysops.
Possibly I arrived during that era.
Rob Church
On 10/01/07, Rob Church robchur@gmail.com wrote:
On 10/01/07, David Gerard dgerard@gmail.com wrote:
It would also be good if trusted users (say, anyone whose login is over four days old) could run SQL directly on the en: database. I have a few outer joins I really really need to check.
In an ideal world, you could use the toolserver for it. The problem with trusting people to run even select queries on the English Wikipedia database is that trust does not equal sufficient SQL ability to write queries which do not suck up all our time, even with Tim's natty timeout script.
I WAS JOKING. I SWEAR TO GOD.
- d.
David Gerard schrieb:
On 10/01/07, Rob Church robchur@gmail.com wrote:
On 10/01/07, David Gerard dgerard@gmail.com wrote:
template code directly in the hardware. Also, Visual Basic for MediaWiki needs to be implemented.
You wash out your mouth with bleach this instant.
But it is merely a simple matter of programming!
It would also be good if trusted users (say, anyone whose login is over four days old) could run SQL directly on the en: database. I have a few outer joins I really really need to check.
I would suggest either using toolserver or downloading a database dump and play it in on your machine. And every user older than 4 days...it would attract vandals. Think of a really big SELECT, mixed with some JOINs and you put the server load to unusable...
Marco
"Marco Schuster" CDL-Klever@gmx.net wrote in message news:45A53693.90407@gmx.net...
David Gerard schrieb:
On 10/01/07, Rob Church
robchur@gmail.com wrote:
On 10/01/07, David Gerard
dgerard@gmail.com wrote:
template code directly in the hardware. Also, Visual Basic for MediaWiki needs to be implemented.
You wash out your mouth with bleach this instant.
But it is merely a simple matter of programming!
It would also be good if trusted users (say, anyone whose login is over four days old) could run SQL directly on the en: database. I have a few outer joins I really really need to check.
I would suggest either using toolserver or downloading a database dump and play it in on your machine. And every user older than 4 days...it would attract vandals. Think of a really big SELECT, mixed with some JOINs and you put the server load to unusable...
Marco
That's the whole point - so that vandals can query the database to find pages that aren't on anybody's watchlist!
- Mark Clements (HappyDog)
Marco Schuster wrote:
I would suggest either using toolserver or downloading a database dump and play it in on your machine. And every user older than 4 days...it would attract vandals. Think of a really big SELECT, mixed with some JOINs and you put the server load to unusable...
No offense, but some list members need to adjust their sarcasm detectors... :)
Matt Flaschen
David Gerard wrote:
On 10/01/07, Rob Church robchur@gmail.com wrote:
On 10/01/07, David Gerard dgerard@gmail.com wrote:
template code directly in the hardware. Also, Visual Basic for MediaWiki needs to be implemented.
You wash out your mouth with bleach this instant.
But it is merely a simple matter of programming!
It would also be good if trusted users (say, anyone whose login is over four days old) could run SQL directly on the en: database. I have a few outer joins I really really need to check.
- d.
Yes, and I'd like to see what happens if we make all anonymous users stewards. It's a wiki, after all!
-Gurch
On 1/10/07, Gurch matthew.britton@btinternet.com wrote:
Yes, and I'd like to see what happens if we make all anonymous users stewards. It's a wiki, after all!
That's silly. It would be so much simpler if we just publicized the root password for all the servers and permitted anyone full physical access to the server clusters. Ideally we'd also pay for express plane flights for anyone to visit the servers to fiddle with them manually, to lower barriers to entry.
On 10/01/07, Simetrical Simetrical+wikitech@gmail.com wrote:
On 1/10/07, Gurch matthew.britton@btinternet.com wrote:
Yes, and I'd like to see what happens if we make all anonymous users stewards. It's a wiki, after all!
That's silly. It would be so much simpler if we just publicized the root password for all the servers and permitted anyone full physical access to the server clusters. Ideally we'd also pay for express plane flights for anyone to visit the servers to fiddle with them manually, to lower barriers to entry.
Indeed. The whole point is to let any idiot edit your website, and hope the good idiots outnumber the bad idiots. So the real problem we need to solve is how to build a better idiot.
- d.
David Gerard wrote:
On 10/01/07, Domas Mituzas midom.lists@gmail.com wrote:
Just an update on the issue - it appears Spanish users took the template from Italians. Though on it.wikipedia it runs in ~1s, it runs 20s on Spanish, so obviously, just "taking teh template" didn't work that well.
Obviously, with the fantastically stupid^Wcreative things people are doing with templates, we need to write a Template Virtual Machine just for running templates.
Finally, we can prove once and for all that templates are Turing-complete. :)
Matthew Flaschen
David Gerard wrote:
On 10/01/07, Domas Mituzas midom.lists@gmail.com wrote:
Just an update on the issue - it appears Spanish users took the template from Italians. Though on it.wikipedia it runs in ~1s, it runs 20s on Spanish, so obviously, just "taking teh template" didn't work that well.
Obviously, with the fantastically stupid^Wcreative things people are doing with templates, we need to write a Template Virtual Machine just for running templates. Or design a mask for a FPGA that will execute template code directly in the hardware.
Having actually used an FPGA, you don't need to design a mask; just a sound knowledge of VHDL (and by extension, Ada), a few bottles of turps, and a sledgehammer to pound your face against when the @#$% software decides that it understands a completely different subset of VHDL syntax to what you wrote your program in...
On 1/10/07, Domas Mituzas midom.lists@gmail.com wrote:
Just an update on the issue - it appears Spanish users took the template from Italians. Though on it.wikipedia it runs in ~1s, it runs 20s on Spanish, so obviously, just "taking teh template" didn't work that well.
1 entire second could be a problem: that template seems to be part of the interproject linking template, something which is used on *many* pages to link to commons, wikiquote, etc.
Alfio
wikitech-l@lists.wikimedia.org