This is a follow-up for, and postponed on it.
Now that we have all link generation centralized into one of two methods on the generator, we need to make it faster. The obvious way to do that is to cache requests to generateFromRoute() and generateFromPath(), so that we catch all of the work done by the outbound path processors.
For path alias lookups, we did that with a wrapping object. I think it makes sense to do the same here, with an object that has the same interfaces as the generator but simply forwards requests to it and then caches them. The pattern established by the path alias cache should work fine here. (I think it's now using the Destructable interface? If not, we should do that.)
We may also want to consider removing the cache wrapper from path alias lookups once we're done. We probably shouldn't do that in this patch, but a follow up would be to benchmark and see if it's still useful, and if not, get rid of it to avoid the complexity and extra cache storage.
|FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 68,328 pass(es), 0 fail(s), and 3 exception(s).|
|FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 68,129 pass(es), 0 fail(s), and 35 exception(s).|
|FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 68,042 pass(es), 84 fail(s), and 72 exception(s).|