-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: Use WeakMap
for wrapper to impl conversion
#155
feat: Use WeakMap
for wrapper to impl conversion
#155
Conversation
Thanks; I've been interested in doing this for some time. But, I'm concerned about the performance hit. Can you post the results of the jsdom benchmark suite before and after? |
eb83b86
to
28823db
Compare
Well, here’s the benchmark result for Node.js 13.5.0 on my PC:
|
The large variability combined with the giant slowdown in the create* tests makes me kinda wary of this. Are we doing something weird in createNode that taxes on WeakMaps so much? |
I ran the benchmark locally and I was able to measure a noticeable slowdown locally. All the interface creation tests are 3x slower using The variability of the benchmark results might be explained by 2 things:
Based on the benchmark data, I feel uncomfortable introducing such a large regression compared to the value-added. Benchmark result on Macbook Pro 2015 / Node 12.13.1
|
I agree; this is not worth the cost. So, let's close. |
Currently, wrapper → impl mapping is done using a symbol.
The issue with this approach is that it causes several observable
[[Get]]
s on the object, which causes some WPT failures, and can lead to implementation leakage, as described in the class fields proposal.