-
-
Notifications
You must be signed in to change notification settings - Fork 179
refactor: changed __UglifyJsPlugin
dereference to use WeakSet
instead
#57
refactor: changed __UglifyJsPlugin
dereference to use WeakSet
instead
#57
Conversation
__UglifyJsPlugin
dereference to use WeakSet
instead
Change the base branch back to |
Interesting, I didn't expect using a It looks like this needs a rebase to get rid of the indent changes, though. |
@Kovensky that is to say, this was the old code:
So there's a dangling reference there. No object inside compilation.assets ever gets the prop appended! e.g. https://jsfiddle.net/jqs4c96k/2/ |
Oh interesting, the weakSet is in the wrong spot? Can different compilations have the same asset? |
@mikesherov what u mean wrong spot? |
Can be placed at RequestShortener's scope? |
You're right... I considered that but i wonder if in principle it's actually better to keep it in 'optimize-chunk-assets` handler scope... For ex... i thought about how this might behave in watch mode and wondered if this would cause an issue. |
It can't possibly, it's a WeakSet! It won't leak memory, and a match will only happen when it truly should happen! |
Ah, very good point. |
Sry for the heads up, but could we triage landing/not landing |
YESSSSS |
ALRIGHTTTT 😛 :D |
So, as a proof of concept... I created this: https://github.com/hulkish/dummy
Pull that repo, then run:
You will see an output which looks like:
then, you can compare the output of these 2 folders:
dist/[email protected]
dist/[email protected]
The output is the same, but look at the significant difference in time.