-----BEGIN PGP SIGNED MESSAGE-----
Moin,
I have written a small extension and it is very closely modelled to the sample extension. Basically, it uses $wgParser->setHook() and then returns the text that should be included in the output as HTML.
However, for some reasons, the output of my extension is not put straight into the output page. The parser (or whoever :) looks at it, and then checks/transforms it. This creates, IMHO, unec. overhead.
For instance I have to remove leading spaces inside style-tages, or otherwise the output becomes garbled. Likewiese, things like <br> are transformed into <br /> (this is harmless, but unec.).
How do I stop whatever get's my extension's output and "mangles" it? I want the text from my extension be included verbatim into the page (basically because I trust my extension to return valid HTML - if it doesn't, the extra check/transform from Wikimedia will not help, anyway)
Another small question: How would one go and benchmark an extension including the overhead from the wiki? Editing pages via script and measure how long it takes for each submit? Has anybody done this before?
Thanx,
Tels
PS: Sorry if this is the wrong place to ask - I am not very familiar with the /.*wiki.*/ background :)
- -- Signed on Fri Mar 11 11:26:03 2005 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email.
"You know the world is going crazy when the best rapper is a white guy, the best golfer is a black guy, the tallest guy in the NBA is Chinese, the Swiss hold the America's Cup, France is accusing the U.S. of arrogance, Germany doesn't want to go to war, and the three most powerful men in America are named 'Bush', 'Dick', and 'Colon'. Need I say more?" -Chris Rock
Tels wrote:
I have written a small extension and it is very closely modelled to the sample extension. Basically, it uses $wgParser->setHook() and then returns the text that should be included in the output as HTML.
However, for some reasons, the output of my extension is not put straight into the output page. The parser (or whoever :) looks at it, and then checks/transforms it. This creates, IMHO, unec. overhead.
Some steps, eg doBlockLevels(), do run after extensions are inserted into the output. I'm not sure if there's a good reason for this.
How do I stop whatever get's my extension's output and "mangles" it?
Hack up the parser to work differently... :)
Another small question: How would one go and benchmark an extension including the overhead from the wiki? Editing pages via script and measure how long it takes for each submit? Has anybody done this before?
Apache comes with a simple benchmarking tool, 'ab'. You can use this to run a bunch of repeat requests and give back some timing information.
If you disable the parser cache in 1.4, the page will be re-rendered for each hit and your extension will be called each time.
There's also an internal profiling; turn on the debug log and $wgProfiling and internal timings will be dumped to the log. Add appropriate wfProfileIn()/wfProfileOut() calls in your functions to include details on them.
-- brion vibber (brion @ pobox.com)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Brion Vibber schrieb:
Tels wrote:
How do I stop whatever get's my extension's output and "mangles" it?
Hack up the parser to work differently... :)
Didn't test it, but woulf it help to wrap the extension output in <nowiki> tags? Or is the nowiki parsing done before the extensions?
Magnus
-----BEGIN PGP SIGNED MESSAGE-----
Moin,
On Saturday 12 March 2005 14:51, Magnus Manske wrote:
Brion Vibber schrieb:
Tels wrote:
How do I stop whatever get's my extension's output and "mangles" it?
Hack up the parser to work differently... :)
Didn't test it, but woulf it help to wrap the extension output in <nowiki> tags? Or is the nowiki parsing done before the extensions?
Good idea. I try it. Thanx to both of you for the explanations.
Best wishes,
Tels
- -- Signed on Sat Mar 12 14:58:53 2005 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email.
"Elliot, Sie Schwachkopf!"
wikitech-l@lists.wikimedia.org