Template talk:Murinae

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Mammals (Rated NA-class)
WikiProject icon This template is within the scope of WikiProject Mammals, a collaborative effort to improve the coverage of mammal-related subjects on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 NA  This template does not require a rating on the project's quality scale.
 

Substitution[edit]

This page had an enormous post-expand size, leading to slow page loads and limiting the number of templates that could be used on pages. Therefore I subst'd many of the templates. Martin (Smith609 – Talk) 18:01, 9 January 2011 (UTC)

My changes and template performance[edit]

Now that {{Navbox}} is using the Lua programming language, it seemed to me that there is little point in leaving this template in its present messy form, with all the big Navbox templates "subst"ed out. Among other disadvantages, it makes the template almost uneditable, and precludes any significant future development. The need, back in January 2011, to subst them out was understandable, though: the maximum limit on post-expand is 2,048,000 bytes, and the version before subst-ing takes 1,468,208 bytes (see full performance data below; the actual performance at the time would have been worse, because of using the pre-Lua version of Navbox). Not surprising that something had to be done. The present, fully-"subst"ed version uses only 309,673 bytes.

It is obvious that switching back to standard templates would increase the post-expand size; on the other had, we now have Lua, and the switch to hlist formatting gets rid of all those ugly and costly-en-masse dot-templates, a significant saving.

My first attempt is now in the sandbox. Its post-expand size is 1,079,012 bytes - a lot better than the pre-subst version, but still too high at 53% of the total limit. So I edited it to get rid of {{Navbox with collapsible groups}}, which brings it down to 606,565 bytes - still quite high, I think, but acceptable. (Note that you have to exclude the documentation template to get comparable figures). This is now the current version, after my update.


Version of 02:19 12 September 2010 (pre-subst):

<!-- 
NewPP limit report
Parsed by mw1023
CPU time usage: 2.636 seconds
Real time usage: 2.704 seconds
Preprocessor visited node count: 14227/1000000
Preprocessor generated node count: 23167/1500000
Post-expand include size: 1468208/2048000 bytes
Template argument size: 207734/2048000 bytes
Highest expansion depth: 13/40
Expensive parser function count: 1/500
Lua time usage: 0.149s
Lua memory usage: 1.86 MB
-->

Fully-subst-ed version (immediately before my update):

<!-- 
NewPP limit report
Parsed by mw1218
CPU time usage: 1.400 seconds
Real time usage: 1.460 seconds
Preprocessor visited node count: 2314/1000000
Preprocessor generated node count: 11636/1500000
Post-expand include size: 309673/2048000 bytes
Template argument size: 1489/2048000 bytes
Highest expansion depth: 6/40
Expensive parser function count: 1/500
Lua time usage: 0.014s
Lua memory usage: 1.25 MB
-->

Sandbox version, (using Navbox with collapsible groups)

<!-- 
NewPP limit report
Parsed by mw1094
CPU time usage: 1.652 seconds
Real time usage: 1.706 seconds
Preprocessor visited node count: 3743/1000000
Preprocessor generated node count: 19645/1500000
Post-expand include size: 1033094/2048000 bytes
Template argument size: 113529/2048000 bytes
Highest expansion depth: 12/40
Expensive parser function count: 1/500
Lua time usage: 0.199s
Lua memory usage: 1.64 MB
-->

Current version:

<!-- 
NewPP limit report
Parsed by mw1050
CPU time usage: 1.436 seconds
Real time usage: 1.487 seconds
Preprocessor visited node count: 2950/1000000
Preprocessor generated node count: 11884/1500000
Post-expand include size: 606565/2048000 bytes
Template argument size: 11658/2048000 bytes
Highest expansion depth: 7/40
Expensive parser function count: 1/500
Lua time usage: 0.131s
Lua memory usage: 1.48 MB
-->

Note that these tests all exclude the documentation template, since it doesn't get transcluded on actual pages.

--NSH002 (talk) 11:58, 29 January 2014 (UTC)

Thoughts on future development[edit]

This is a very large navbox, transcluded onto many pages. This is not a good idea!

Instead I suggest that it is split up. Now that the template has been standardised, it will be a fairly easy job for someone to create 10 new navboxes, based on each of the sections here (but check that similar navboxes don't already exist). Then just string them all together in one simple template to replace this one. For an example of how to do this, see {{London churches}}.

I also have some thoughts on how the whole set of mammals templates should be organised (borrowing some ideas from the medical templates) and applying appropriate styles. Will post them later on the project talk page when and if I get time to refine them further.

--NSH002 (talk) 11:58, 29 January 2014 (UTC)

More thoughts:

Splitting up and stringing separate templates together is unlikely to solve the include size problem, and in fact may even make it worse. This template should be thought of mostly as a reference, and should be transcluded as a whole at most only on one or two articles, say the main article for the topic, and/or a list article. Transclusions on all the other articles should be replaced by the appropriate sub-template; each of those sub-templates could contain links to this one and to its siblings, probably in the | below = line. Might be worth extending this idea to the whole project, and making a standard template, or set of templates, to provide these | below = links. See the medical templates for some ideas. --NSH002 (talk) 12:27, 29 January 2014 (UTC)

Update[edit]

As predicted, splitting up and stringing together separate templates did indeed increase the include size (to 920,816 bytes) but this is worth it for the improved manageability and vast reduction in the link overhead.

<!-- 
NewPP limit report
Parsed by mw1035
CPU time usage: 2.592 seconds
Real time usage: 2.685 seconds
Preprocessor visited node count: 3511/1000000
Preprocessor generated node count: 11658/1500000
Post‐expand include size: 920816/2048000 bytes
Template argument size: 253476/2048000 bytes
Highest expansion depth: 15/40
Expensive parser function count: 20/500
Lua time usage: 0.141/10.000 seconds
Lua memory usage: 1.48 MB/50 MB
-->

--NSH002 (talk) 20:44, 29 March 2014 (UTC)