Why is new slow?
The main difference between #4 and all other cases is that the first time when you use a closure as a constructor is always quite expensive. It is always handled in V8 runtime (not in generated code) and transition between compiled JS code and C++ runtime is quite expensive. Subsequent allocations usually are handled in … Read more