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

Use native bind instead of custom implementation #5461

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented Feb 12, 2024

Description:
Throughout the code base both the native Function.prototype.bind and a custom AFRAME.utils.bind are used (about 50-50). The latter was introduced as a faster alternative (#1762). However, it seems that this is no longer the case and in fact performs worse:

This PR removes it and introduces a small wrapper of the native bind in the place of AFRAME.utils.bind to avoid breaking any third party code using this utility, while still given them the same perf benefit from switching to native bind.

Changes proposed:

  • Replace usages of utils/bind with native bind
  • Introduce wrapper for AFRAME.utils.bind that uses native bind

@dmarcos
Copy link
Member

dmarcos commented Feb 13, 2024

Thanks

@dmarcos dmarcos merged commit bc3461e into aframevr:master Feb 13, 2024
1 check passed
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