Content deleted Content added
Cobaltcigs (talk | contribs) clarify opinion on wikt links |
Cobaltcigs (talk | contribs) another idea |
||
Line 83:
*1. Consistency of format, avoidance of stupidity like {{diff3|632122404|this}}.
*2 (and 3). [https://i.imgur.com/WuSuoAT.png Here are] four profiler outputs for the [[Template:Unicode chart/testcases|testcases]] page. Note that this is the total churning of five {{tl|unicode chart}}s transcluded on the same page (indirectly through the {{tl|test case}} template/module in fact). Even with those factors the processing stats are at a small fraction of allowable limits in every case except for <code>ifexist</code> (which should probably be the first feature taken out). Actual overhead in the wild would be lower. Based on the percentages at the bottom, it looks like the single worst bottleneck is the grand <code>#switch</code> statement at [[Template:Script]]. We could probably save at least 40% on parser juice by skipping that and moving its fairly trivial functionality (that of choosing a css class and a [[Template:Script/styles hebrew.css|definition for same]], having already obtained an ISO 15924 code from [[Module:Unicode data/scripts|here]]) into some module.
**Note: I'd like to get away from using {{tl|script}} anyway if possible, for reasons outlined at [[Template talk:Script#Module:Unicode chart]]. ―[[special:contributions/cobaltcigs|cobaltcigs]] 20:21, 10 September 2019 (UTC)
*4. Keeping a count of reserved codepoints and rendering the "note" as plural/singular/blank will be a trivial step. I just didn't think of it. I do question whether the footnote system is the appropriate way to present this.
*5. My first version of the module actually did have a parameter accepting whole refs. I just took it out when I got the impression every existing template had the same two notes. I can put it back.
Line 97 ⟶ 98:
*16. I don't see why not. See 13.
―[[special:contributions/cobaltcigs|cobaltcigs]] 18:20, 10 September 2019 (UTC)
One additional advantage of modules vs. conventional templates is that modules can receive and obey parameters based on pattern matching without exhaustively defining every possible parameter name. E.g. the Basic Latin template could call the module with the following extra parameters.
<pre>
| name = Basic Latin
<!-- these rows get dotted boxes or whatever -->
| box_U000x = yes
| box_U001x = yes
<!-- visual aliases for non-printables -->
| display_U0006 = ACK
| display_U0009 = TAB
<!-- printables that are bad titles -->
| link_U0020 = Space (punctuation)
| link_U0023 = Number sign
| link_U00F5 = Underscore
</pre>
The inner loop of the module could check whether such parameter exists and know whether to behave differently. This should be used sparingly but presents a decent solution for exceptional cases, which will be absent from most blocks. ―[[special:contributions/cobaltcigs|cobaltcigs]] 20:21, 10 September 2019 (UTC)
|