Lua rewrite
I've rewritten this template to be based on Module:Tag instead of wikitext. In general, there should be no difference to the input or output, other than a minor invisible change to the rendered HTML syntax, but some aspects of performance should improve under the new implementation. The difference should be significant on pages that transclude this template many times. The following comparisons reflect both the change proposed here and the ones proposed in Template talk:Tag#Lua rewrite and Template talk:TagValue#Lua rewrite. I also replaced {{Keylink}} and {{Valuelink}} to demonstrate that those templates are overkill for discovering key and value description pages.
show
− | NewPP limit report
Cached time: 20240425154817
Cache expiry: 86400
Reduced expiry: false
Complications: [show‐toc]
CPU time usage: 2.541 seconds
Real time usage: 4.818 seconds
Preprocessor visited node count: 23812/1000000
Post‐expand include size: 88109/2097152 bytes
Template argument size: 13847/2097152 bytes
Highest expansion depth: 22/100
Expensive parser function count: 60/500
Unstrip recursion depth: 0/20
Unstrip post‐expand size: 0/5000000 bytes
Lua time usage: 1.870/15 seconds
Lua virtual size: 8728576/52428800 bytes
Lua estimated memory usage: 0 bytes
Number of Wikibase entities loaded: 136/250
Transclusion expansion time report (%,ms,calls,template)
100.00% 4011.936 1 -total
54.01% 2166.719 135 Template:Valuelink
40.11% 1609.353 502 Template:Langcode
29.54% 1185.160 47 Template:Tag
29.21% 1171.937 94 Template:TagPagename
23.28% 933.878 224 Template:LangPrefix
7.91% 317.146 3 Template:Icon
7.83% 314.204 3 Template:LangSwitch
7.72% 309.605 3 Template:LangSwitch/langcode
6.89% 276.338 8 Template:LL | + | NewPP limit report
Cached time: 20240425183407
Cache expiry: 86400
Reduced expiry: false
Complications: [show‐toc]
CPU time usage: 1.393 seconds
Real time usage: 3.057 seconds
Preprocessor visited node count: 9498/1000000
Post‐expand include size: 66782/2097152 bytes
Template argument size: 3497/2097152 bytes
Highest expansion depth: 22/100
Expensive parser function count: 7/500
Unstrip recursion depth: 0/20
Unstrip post‐expand size: 0/5000000 bytes
Lua time usage: 1.610/15 seconds
Lua virtual size: 7294976/52428800 bytes
Lua estimated memory usage: 0 bytes
Number of Wikibase entities loaded: 0/250
Transclusion expansion time report (%,ms,calls,template)
100.00% 2272.115 1 -total
49.22% 1118.316 135 Template:TagValue/sandbox
21.78% 494.916 47 Template:Tag/sandbox
15.57% 353.697 3 Template:Icon
15.40% 349.963 3 Template:LangSwitch
15.22% 345.717 3 Template:LangSwitch/langcode
12.70% 288.605 8 Template:LL
12.52% 284.451 42 Template:LangPrefix
11.25% 255.687 84 Template:Langcode
5.77% 131.162 10 Template:TagKey/sandbox |
show
− | NewPP limit report
Cached time: 20240425183713
Cache expiry: 86400
Reduced expiry: false
Complications: [show‐toc]
CPU time usage: 1.717 seconds
Real time usage: 3.231 seconds
Preprocessor visited node count: 38789/1000000
Post‐expand include size: 165481/2097152 bytes
Template argument size: 33894/2097152 bytes
Highest expansion depth: 23/100
Expensive parser function count: 10/500
Unstrip recursion depth: 0/20
Unstrip post‐expand size: 8000/5000000 bytes
Lua time usage: 1.450/15 seconds
Lua virtual size: 7806976/52428800 bytes
Lua estimated memory usage: 0 bytes
Number of Wikibase entities loaded: 0/250
Transclusion expansion time report (%,ms,calls,template)
100.00% 2845.905 1 -total
66.21% 1884.407 588 Template:Langcode
64.92% 1847.563 283 Template:Tag
63.29% 1801.099 474 Template:TagPagename
13.75% 391.365 27 Template:TagValue
13.59% 386.770 32 Template:LL
13.44% 382.376 27 Template:TagKey/link
10.72% 305.075 96 Template:LangPrefix
5.19% 147.738 35 Template:TagKey
5.02% 142.910 1 Template:Feature | + | NewPP limit report
Cached time: 20240425183732
Cache expiry: 86400
Reduced expiry: false
Complications: [show‐toc]
CPU time usage: 1.281 seconds
Real time usage: 4.074 seconds
Preprocessor visited node count: 6712/1000000
Post‐expand include size: 122054/2097152 bytes
Template argument size: 4502/2097152 bytes
Highest expansion depth: 23/100
Expensive parser function count: 10/500
Unstrip recursion depth: 0/20
Unstrip post‐expand size: 7926/5000000 bytes
Lua time usage: 2.780/15 seconds
Lua virtual size: 7729152/52428800 bytes
Lua estimated memory usage: 0 bytes
Number of Wikibase entities loaded: 0/250
Transclusion expansion time report (%,ms,calls,template)
100.00% 3676.581 1 -total
76.47% 2811.342 283 Template:Tag/sandbox
6.05% 222.360 27 Template:TagValue/sandbox
5.88% 216.280 35 Template:TagKey/sandbox
3.63% 133.464 1 Template:Feature
2.91% 107.055 41 Template:Langcode
2.65% 97.537 1 Template:Infobox_small
1.89% 69.539 1 Template:Languages
1.44% 52.931 7 Template:LangSwitch
1.09% 39.995 8 Template:Key |
show
− | NewPP limit report
Cached time: 20240425154204
Cache expiry: 86400
Reduced expiry: false
Complications: [show‐toc]
CPU time usage: 1. 077 seconds
Real time usage: 1. 994 seconds
Preprocessor visited node count: 22247/1000000
Post‐expand include size: 195289/2097152 bytes
Template argument size: 13989/2097152 bytes
Highest expansion depth: 24/100
Expensive parser function count: 12/500
Unstrip recursion depth: 0/20
Unstrip post‐expand size: 2/5000000 bytes
Lua time usage: 0. 870/15 seconds
Lua virtual size: 8892416/52428800 bytes
Lua estimated memory usage: 0 bytes
Number of Wikibase entities loaded: 3/250
Transclusion expansion time report (%,ms,calls,template)
100.00% 1731. 395 1 -total
61. 63% 1067.097 1 Template:KeyDescription
42.70% 739.367 211 Template:Langcode
30. 63% 530. 362 45 Template:LangSwitch
29. 36% 508. 300 126 Template: TagPagename
25. 13% 435. 178 42 Template: LangSwitch/langcode
22. 73% 393. 484 1 Template:DescriptionLinks
22. 41% 387. 925 1 Template:TaginfoLinks
21. 79% 377. 214 46 Template: Tag
20. 92% 362. 248 31 Template:TaginfoLinksPerLanguage | + | NewPP limit report
Cached time: 20240425154204
Cache expiry: 86400
Reduced expiry: false
Complications: [show‐toc]
CPU time usage: 0. 906 seconds
Real time usage: 1. 837 seconds
Preprocessor visited node count: 17099/1000000
Post‐expand include size: 187598/2097152 bytes
Template argument size: 8756/2097152 bytes
Highest expansion depth: 24/100
Expensive parser function count: 12/500
Unstrip recursion depth: 0/20
Unstrip post‐expand size: 2/5000000 bytes
Lua time usage: 0. 880/15 seconds
Lua virtual size: 8896512/52428800 bytes
Lua estimated memory usage: 0 bytes
Number of Wikibase entities loaded: 3/250
Transclusion expansion time report (%,ms,calls,template)
100.00% 1586. 358 1 -total
60. 43% 958.644 1 Template:KeyDescription
29. 22% 463. 548 45 Template:LangSwitch
25. 02% 396. 963 42 Template: LangSwitch/langcode
22. 98% 364. 478 45 Template: Tag/sandbox
21. 72% 344. 635 1 Template:DescriptionLinks
21. 37% 338. 993 1 Template:TaginfoLinks
21. 19% 336. 174 103 Template: Langcode
19. 89% 315. 575 31 Template:TaginfoLinksPerLanguage
5.83% 92.427 7 Template:DescriptionLang |
The Lua module is passing a battery of tests, but more test cases are always welcome. If no showstopping issues are identified, I'd like to deploy these two rewrites soon so we address some of the performance problems that have been identified on large pages.
– Minh Nguyễn 💬 16:50, 14 April 2024 (UTC)
Resolved: I've deployed the changes. – Minh Nguyễn 💬 07:09, 7 May 2024 (UTC)