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

refactor(internal): Reduce frequent accesses to the same private property #915

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

absidue
Copy link
Collaborator

@absidue absidue commented Mar 3, 2025

In some methods we were accessing the same private property lots of times. As the private property polyfill results in extra code and runtime overhead for each private property access, in some of those methods I decided to read it into a local variable once at the top of the method and then use that local variable in the other places. While this is probably not a major bottleneck, it doesn't hurt and results in smaller code size which is great for people that are bundling YouTube.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant