Premising that the constructor of PhutilURI is relatively slow,
because it calls various regular expressions to match the domain, the anchor, etc.
https://we.phorge.it/source/arcanist/browse/master/src/parser/PhutilURI.php
Note that the method PhabricatorEnv::isSelfURI() creates multiple PhutilURI objects,
just to check if the configuration domains are matched.
Note that isSelfURI() can be called multiple times during a page lifecycle,
especially for big Remarkup documents with many internal/external links.
So, we increase the efficiency of PhabricatorEnv::isSelfURI(), by adding a minimal domains
cache, so to avoid the re-creation of PhutilURI objects for each isSelfURI() call.
This should be safe since the global configuration is not supposed to change during the page load.
Anyway, we already covered the already-existing dropConfigCache() that is called when this happens,
for example in some unit tests.
Good for your CPU, for your performances, for your electric bills, for the stress of your
your garbage collector, and for your environment. You're welcome Greta Thunberg.
Closes T16061