symfony/symfony — pull request #12069 by Nicofuma (2014-09-27 22:49:32+00:00)
Title: [EventDispatcher] Moves the logic of addSubscriberService to the compiler pass

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |

Currently when an event subscribers is registered as a to be lazy loaded service, the corresponding class (and so at least a file) is loaded and parsed even if this subscriber isn't used at all. And when you have a lot of events subscribers (with phpBB extensions we can easily have dozens of subscribers) it could represent a lot of files (due to the use statements we rarely have only one file to load) and on some systems (i.e if you don't have an opcode cache) it could be important on the performance side.