Skip to content

[EventDispatcher] Improve performance in "dev" environment #31970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
javiereguiluz opened this issue Jun 10, 2019 · 0 comments
Closed

[EventDispatcher] Improve performance in "dev" environment #31970

javiereguiluz opened this issue Jun 10, 2019 · 0 comments

Comments

@javiereguiluz
Copy link
Member

Description

The upcoming Symfony 5.0 release gives us once-in-a-two-years opportunity to improve things. I'd like to improve this: events/listeners take too much time in the "dev" environment.

Look at this profiling of the Symfony Demo app: https://blackfire.io/profiles/f35213c7-d5b5-4eb4-8315-4ad3f24ac9e9/graph

Some things that look "wrong":

  • Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher::getNotCalledListeners is the slowest part of the application and takes 15% of the total time.
  • Symfony\Component\EventDispatcher\Debug\WrappedListener::getWrappedListener is called 5,135 times
  • Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher::getListenerPriority is called 279 times

Can someone please take a look why this is so slow ... and see if we can improve it even if it requires making some minor breaking changes? Thanks!

@fabpot fabpot closed this as completed Jun 11, 2019
fabpot added a commit that referenced this issue Jun 11, 2019
…y once (xabbuh)

This PR was merged into the 4.3 branch.

Discussion
----------

[EventDispatcher] collect called listeners information only once

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

Commits
-------

284262a collect called listeners information only once
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants