Skip to content

Conversation

JiaLiPassion
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

Since now DebugNode__PRE_R3__.triggerEventListener will use eventListeners method here

// We need to check whether `eventListeners` exists, because it's something
and it will use the method provided by zone.js, the current implementation is not performance efficient because it will loop all properties of the target and use regular expression to check the property name.

This PR will do better.

  1. if the eventName parameter is not null (which is the most cases), we can directly get the event tasks from target.
  2. if the eventName parameter is null, we will use the original logic.

@JiaLiPassion JiaLiPassion requested a review from a team as a code owner January 2, 2020 14:04
@JiaLiPassion JiaLiPassion added area: performance Issues related to performance area: zones Issues related to zone.js labels Jan 2, 2020
@ngbot ngbot bot added this to the needsTriage milestone Jan 2, 2020
@JiaLiPassion JiaLiPassion added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker and removed action: merge The PR is ready for merge by the caretaker labels Jan 31, 2020
@IgorMinar IgorMinar added the action: presubmit The PR is in need of a google3 presubmit label Jan 31, 2020
@mhevery
Copy link
Contributor

mhevery commented Jan 31, 2020

presubmit

@mhevery mhevery force-pushed the event-listeners-perf branch from a9fa826 to d60e783 Compare January 31, 2020 21:28
mhevery pushed a commit that referenced this pull request Feb 3, 2020
@mhevery mhevery closed this in a3c7ab9 Feb 3, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit area: performance Issues related to performance area: zones Issues related to zone.js cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants