Subject: | cache parsed URI components for performance |
For dramatic performance improvement, cache the parsed URI components so the URI string doesn't have to be repeatedly parsed. For instance, if you need access to several component methods or call the same component method multiple times, the URI string is parsed each time. The documentation should at the very least mention this and advise the user to save the result if they need to use it multiple times- for example, testing $uri->host against multiple values. But it would be even better to implement the caching internally to URI.