Open aduh95 opened 1 year ago
Hm, you're probably right. Going to hold off on landing this until it's feature complete, though. At that point, the next painful step will be porting path-scurry to use it, to see just how bad the perf impact is.
I may end up essentially just making all of these things fn.apply(thisp, args)
anyway (which is imo even more readable and likely more performant than ReflectApply, albeit not hardened at all).
The reason for that weird idiom is because I'm trying (for now) to mirror node's implementation as closely as possible, with the main difference that the exports are unrolled for the benefit of TypeScript.
Reflect.apply is ok perf wise IIRC, on par with fn.apply. It’s slower if you have to allocate an array, but in these cases the array is already there.
It should perform better, and is also more readable imho.