Skip to content
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

Optimized Events.trigger method when no event is emitted #553

Merged
merged 1 commit into from
Jun 12, 2018

Conversation

bchevalier
Copy link
Contributor

For my particular use case the Events.trigger method was taking roughly 5% of the resources of the physics engine even though no event was emitted. This brings it down to >1%.

It is a small overhead when events are used though. However I think that one sound logic is to accept overhead for optimizing out optional features as they will rarely all be used.

@liabru
Copy link
Owner

liabru commented Feb 10, 2018

Looks fine, but can you change this to use Common.keys instead of Object.keys (for consistency and compatibility)? Thanks!

@liabru liabru merged commit b17cb48 into liabru:master Jun 12, 2018
@liabru liabru mentioned this pull request Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants