joomla/joomla-cms — pull request #2832 by pasamio (2014-01-23 23:24:35+00:00)
Title: Cache loading router to prevent extra filesystem calls

This change shifts the code to import the component specific router in a single function instead of inlining it with the rest of the SEF route generation code. This should also make this segment of code easier to unit test later.

The main reason for the change is to prevent redundant file_exists checks for the router when the router has already been loaded. This is problematic on slow disks and in situations where JFile::read is used (JFile::read triggers clearstatcache which wipes out PHP's cache; this is irrelevant to Joomla as the file would have already been loaded anyway).

This can help improve performance particularly on network shared Joomla instances (e.g. NFS filer).