Jump to content

PLURAL and GENDER optimization

This has to do with the way expansion works: an empty GENDER (with the same parameter) is eliminated directly and cached thoughout messages, it does not fill any cache slot and potentially saves memory or avoids bugs in the wiki server duiring expansion (I can see some visible performance benefits on page rendering, it is small I admit it, but there's no real need to pass it static parameters that will be returned unconditionnally as is).

Anyway it just remains glued with the term on which it was supposed to apply, so I don't see why it looks wrong when it fact it's just removing any parts that will be unconditionally returned. Being empty, it just means that it has been considered but not really needed (except on TWN itself due to its local validation rules).

In fact, when exporting, such GENDER: or PLURAL: rules with a single possible output could also be automatically dropped (keeping only its unconditional return value, often empty, and the target wiki would be even more satistified. Such cleanup could as well be done by the script importing into the target wiki (to avoid unnecessary work at expansion time). If an empty GENDER: or PLURAL: looks weird for you then a non-empty one returning a non-empty constant text is equally weird because in both cases it is not necessary at all.

Verdy p (talk)08:19, 16 August 2022

Is this performance impact documented anywhere?

Amir E. Aharoni (talk)13:26, 16 August 2022

I am confident that there is no such performance impact that would be relevant here. The syntax convention should be based on other criteria, some of which are already mentioned above.

Nike (talk)14:15, 16 August 2022