Page MenuHomePhorge

PhabricatorEnv isSelfURI(): add small cache of these self-URIs
Open, WishlistPublic

Description

While improving some Remarkup aspects and trying to do my best to avoid to build expensive PhutilURI objects... I've noticed that the PhabricatorEnv#isSelfURI() does not have a cache at the moment, and it always rebuilds its internal list of PhutilURI, every time you call the method.

https://we.phorge.it/source/phorge/browse/master/src/infrastructure/env/PhabricatorEnv.php;9047e940e0637efdea0bbb19bd9d122edbe8d418$441-442

Unclear where I should tag this. This may be just related to Performance and micro-optimizations.

Suggested unit tests, if you will ever work on this:

arc unit ./src/infrastructure/parser/__tests__/PhutilPygmentizeParserTestCase.php
arc unit ./src/infrastructure/markup/remarkup/__tests__/PhutilRemarkupEngineTestCase.php