Chad,

> I personally haven't, but if you've got some good profiling data from
> WMF usage of this stuff it would certainly be helpful :)

Well, in simple micro-benchmarking, wfMsg("pagetitle") took 0.5ms on  
enwiki and 5ms on frwiki (thats _without_ any initialization overhead).
First call to enwiki's message (initialization of message cache, etc)  
took ~4ms, on frwiki - 14ms.

Tight runs of 1000 wfMsg("pagetitle") calls ended up running for 5s on  
frwiki and 0.5s on enwiki.

So, now that I somewhat debunked that it is initialization-cost-only,  
let's move on to actual work that is being done.

For your comparison, I made two profiles for 10-count-run  
(unfortunately, xdebug profile would take way too much space, if I  
attempted to do longer run), one for optimized, no-{{ execution path:
http://noc.wikimedia.org/~midom/messages-codepath/en.png

And 10x-more-expensive one:
http://noc.wikimedia.org/~midom/messages-codepath/fr.png

So, apparently, if we want dynamic messages, we have to spend not just  
'additional cycles' ;-)

It is much easier to read those graphs if you take a look at call  
counts (anything what is 10x or more is usually being executed for  
each wfMsg() call, whereas other stuff is initialization-only).
Also do note, as I was running it in command line, AutoLoader is way  
higher than it should be, so setup costs are quite inflated.

Also, the base is 55%, remaining part is mediawiki framework setup  
(configuration, databases, etc).

Anyone, one can see, lion's share is Parser->preprocess, which doesn't  
do any initialization here, pure parser magic (though it probably has  
some revisits to magic words and Title code that could be removed).
So yes, parser init adds about 5ms, so does message cache, but then  
every message that has {{'s adds up 5ms each - but message cache init  
will be much cheaper once new cdb-based code goes live.

Anyway, if anyone still thinks that individual interface messages on  
every page should take 5ms each to render, let me know, I can  
unsubscribe you from this list myself, you won't have to worry about  
that.

Cheers,
Domas

P.S. If anyone wants to look at raw profile files, they're at 
http://noc.wikimedia.org/~midom/messages-codepath/

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to