On dewp exist unused namespaces where currently are no pages in it (Gadget, Gadget Discussion, Gadget-Definition, Gadget-Definition Discussion and Thema).
As there is nothing to search it would be useful to hide those no content namespaces in the drop-menu of the search form.
The technology to do this exists. There is SiteStats::pagesInNs() in PHP, used for e.g. the {{PAGESINNAMESPACE:…}} ParserFunctions as well as in Scribunto. While none of the existing use cases run this in a loop, doing so should be fine. The results are cached via main WAN cache for 1 hour.
Baseline:
- Remove namespaces from the array that's send to the client when SiteStats::pagesInNs() returns zero. It's just noise that can't be used for anything anyway.
To be discussed:
- Is it helpful to see that a namespace exists? If so, is it relevant that this happens in this particular place?