Module talk:Unicode chart: Difference between revisions

Content deleted Content added
three comments and two new sections
skipping script template is indeed a major speed gain
Line 43:
 
*1. Consistency of format, avoidance of stupidity like {{diff3|632122404|this}}.
*{{done}} 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.
**{{done}} 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)
**{{done}} Now skipping inner use of the {{tl|script}} template and the outer use of the {{tl|test case}} template, the "CPU time usage" is down to [https://i.imgur.com/hm0qQhM.png 0.436 seconds] for rendering same five charts as above. ―[[special:contributions/cobaltcigs|cobaltcigs]] 22:44, 12 September 2019 (UTC)
*4. {{done}} 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. {{done}} 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.