Spin-off from. Symfony's kernel calls registerBundles() every request, not only when rebuilding the container. That's because Symfony's BundleInterface supports a boot() method. If DrupalKernel's registerBundles() implementation invokes the autoloader for a bundle class in every enabled module on every request, that adds a substantial amount of time (>5%) to every request.
- Skip the autoloader, but that requires the .module file to explicitly load its bundle class.
- We decide to not support a boot() method in Drupal, in which case, we can limit loading bundle classes to only during container rebuilding.
- We implement autoloader caching (for non-APC as well as APC).
- We implement our own custom registerBundles() caching.
This patch does the first as an interim step until we implement one of the other 3 options.