Rich Harris

Results 788 comments of Rich Harris

Actually, I take it back — the initial case, where `foo` isn't replaced inline, isn't handled yet. It's planned though!

Yes, but one thing at a time 😀 That would be a separate optimisation that determined a) if a variable was only used once, and b) whether it would be...

(Incidentally, Closure generates code like you suggest; Uglify doesn't)

Not talking about removing identifiers in *objects*, just in object *patterns*. Do you know if that has the same performance implications?

Am saying that in this situation... ```js // current !function(){var{foo:a,bar:b}=obj;console.log(a)}() // better? !function(){var{foo:a}=obj;console.log(a)}() ``` ...we're not affecting the shape of `obj` in any way, we're just not creating a local...

Can you share an example file where this is happening?

In general I feel that tools should *not* know anything about prior transformations — it means that every single step in a build pipeline has to reimplement the same logic,...

Sure. Just need to figure out which options are necessary

It depends on the codebase. GCC performs better on some — domvm apparently being one of them — but not others. I'll re-run the numbers in a bit and post...

Alright, I ran some numbers — minified, zipped, and times. (Don't pay too much attention to the times, I'm half way through figuring out a better way to benchmark this...