Category talk:Proto-Niger-Congo language

, any idea why autocat is failing here? —Μετάknowledge discuss/deeds 17:16, 13 July 2021 (UTC)
 * It's hitting the template expansion limit due to the huge number of daughter languages. This happens when trying to create the family tree diagram for all the languages. If you go to Category:Proto-Atlantic-Congo language and click "Show preview" and then open up "Parser profiling data" at the bottom, you can see the "Post-expand include size" is listed as 2,022,419/2,097,152 bytes, i.e just barely under the limit, and since Proto-Niger-Congo has even more daughters, it goes over the limit. To fix this, either:

In terms of making the code more efficient: The generated code for e.g. Old High German looks like this: The obvious places to make this more efficient are replacing the  with an actual NBSP char and shortening the CSS class and ID names. Can you help here? Is it possible to replace ID's like  with something much shorter? I don't really know what the ID does or how it works. Similarly, it seems like everywhere that has the word  could be replaced e.g. with , although I can't see where classes like   are defined; not in MediaWiki:Common.css, for example. Benwing2 (talk) 01:06, 14 July 2021 (UTC)
 * 1) Make the template code that's generated be more efficient. There are various ways to do that, see below;
 * 2) Have a param to not display the family tree at all, and use it here;
 * 3) Have a param to prune certain subtrees from the family tree (e.g. Bantu languages, which you can view at Category:Proto-Bantu language).
 * Thanks for the analysis. My preferred solution would be to prune subtrees. As our trees get more detailed, it is certain that this problem will arise again. Are you able to do that? —Μετάknowledge discuss/deeds 03:28, 14 July 2021 (UTC)
 * Yes, I can make the code do that. Which subtree(s) do you want pruned? Benwing2 (talk) 03:33, 14 July 2021 (UTC)
 * Your suggestion of Bantu seems like the best course of action. (Not that efficiency is a bad idea, by the way! But it may just postpone the problem, rather than solving it.) —Μετάknowledge discuss/deeds 03:39, 14 July 2021 (UTC)
 * I've taken the literal no-break space solution and that has fixed the problem for now. The IDs are just to match parts of the tree with the buttons that toggle them. I played with changing the ID prefix from  to , but that only saves 16,320 out of 1,808,642 of the post-expand include size on this page. (I made changes in MediaWiki:Common.js if you still want to change the ID prefix.) Some of the classes are used in Module:family tree/style.css.   currently isn't used, and removing it would save 174,330 out of 1,824,962 bytes in this page's template include size (partly because removing the class permits removing a HTML tag as well). I'm not enthusiastic about removing classes and HTML tags because people can use them in their personal CSS; User:Suzukaze-c probably used some of them at least in the past, but I can't remember in what stylesheet. But if you want or need to, it should not affect the great majority of users if you tear out any classes not used in Module:family tree/style.css or MediaWiki:Common.js. — Eru·tuon 04:19, 14 July 2021 (UTC)
 * Thank you. I went ahead and changed the top-level `familytree` class to `ftree`, and changed `familytree` everywhere else in classes and ID's to `ft`. I took the relevant code from MediaWiki:Common.js, hacked it to use the new names and put it in User:Benwing2/common.js. (You will have to copy the same code to User:Erutuon/common.js.) You can see the result in User:Benwing2/test-family-tree. This does not include your NBSP hack. This seems to work and reduces the template usage all the way down to 594,849 bytes, which is much smaller than I would have expected but I can't see anything wrong with the generated tree. Please take a look and let me know if something is wrong, as I would not have expected such a reduction. Benwing2 (talk) 04:29, 14 July 2021 (UTC)
 * I'm seeing 1,622,219 bytes (reduced from 1,824,962) when I copy Module:User:Benwing2/family tree to Module:family tree and preview Category:Proto-Niger-Congo language with "Preview page with template". Still a significant reduction, but not as significant. Oh, you must be previewing User:Benwing2/test-family-tree, which doesn't have all the Module:category tree stuff. For that page, the reduction is from 663,294 to 594,849 when comparing the old to the new module (not sure why the difference between the old and new module isn't the same in this page and Category:Proto-Niger-Congo language: 68,445 bytes versus 202,743 bytes). It might be a worthwhile change anyway. The JavaScript code needs to work on both the old and new versions of the family tree (this should do it) until we can reasonably assume all pages have been updated. — Eru·tuon 17:51, 14 July 2021 (UTC)
 * I don't remember either, and don't care about removal. —Suzukaze-c (talk) 04:46, 14 July 2021 (UTC)