-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
refactor: use symbol for private properties #8681
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
Conversation
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
577032e
to
703bc1d
Compare
Thank you for your excellent work! However, I am concerned that using symbols as keys may incur greater performance overhead compared to strings. Can you attempt to test whether it will have a significant impact on performance? If so, we need to consider if this PR is truly worth it. If there is not much performance degradation, we believe your PR is valuable! |
I have tested using both string keys and symbol keys separately. The results show that the performance is almost the same, with a fluctuation between 98% and 102%. Sometimes, symbols even perform slightly faster than strings. In conclusion, I believe that your PR has a minimal impact on performance. |
Size ReportBundles
Usages
|
I have seen many places where HTMLElement's properties are extended, such as the addition of the
_assign
property to the Element in vModel. Should we use Symbol properties for such extensions? This would prevent users from accessing and tampering with these properties.