In my experience, the size of the hosts file matters on some devices, and some os.
On older versions of Windows, for example, networking and browsing slows noticeably as the size of the host file increases.
The same can be said for rootable mobile devices, though it’s less noticeable off WiFi because cellular latency is so much higher.
I would guess, marginal consumer and home routers will suffer with larger hosts files, but I don’t have sufficient experience to claim this for certain.
No, I don't, but years ago [eons], hosts files tended to redirect to 127.0.0.1, which does incur a penalty. Directing to 0.0.0.0 [invalid IP] does not (or not any more).
I also just checked via dig if there is any slowdown and dig didn't report any. (I first queried google.com with the large hosts file, then replaced the hosts file with a default one, cleaned my DNS caches and requeried and it didn't show any speedup.)
Furthermore, I don't know how Pi-Hole works internally so I don't know if it's somehow specially optimized compared to /etc/hosts or implements any caching strategies but wouldn't introducing another server in your DNS chain slow things down more than /etc/hosts which is always present anyways?
On older versions of Windows, for example, networking and browsing slows noticeably as the size of the host file increases.
The same can be said for rootable mobile devices, though it’s less noticeable off WiFi because cellular latency is so much higher.
I would guess, marginal consumer and home routers will suffer with larger hosts files, but I don’t have sufficient experience to claim this for certain.
Background: years of discussions and issues at https://github.com/StevenBlack/hosts, which I maintain.