Domas Mituzas wrote: > Hello, > >> What other people have objected is your position that the only way to >> regain them is to manually replace {{SITENAME}} on all messages. > > I didn't say "manually" ;-) One could have an automated solution :)
An admin bot "template" subster >> Parser->transformMsg() could replace many well-known "{{something" and >> only call preprocess if there's still some "{{". >> It probably means refactoring getVariableValue() and some change at >> CoreParserFunctions or mFunctionHooks, to not make it too ugly, but it >> can be done. > > I find it remarkable that you want to introduce that much of > obfuscation for something, The reason for moving things around is precisely for not duplicating along the already-obfuscated codepath. >what has been resolved for past few years ;-) Last year solutions aren't the solutions of today. > Do note, that such code would need to be maintained for all the > possible cases, would probably fail with certain grammar issues in > some messages, and, dear oh dear, may not really work with > internationalized magicwords ;-) If it can't completly parse it, fallback to the slower preprocess() The messages shall use the canonical namespaces. How much more magic than namespaces have those words? ;-) > Is that code going to be much faster? Avoiding calling the parser? It'd surprise me that it wasn't. But before profiling the results, you won't trick me to give out exact numbers. :-) >> The parser initialization is also quite expensive, but since the >> parser >> will end up being used, I think we can omit it. > > This is very wrong assumption. Parser is not being used in most > article pageviews (e.g. article text is parsed on about 7% of requests > to backend, of course there're quite a few Parser calls by search, > diffs, etc). Ouch. Of course, you're right. I failed to find the most obvious case. _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l