edgedb-js icon indicating copy to clipboard operation
edgedb-js copied to clipboard

Improve the type inference performance of `e.op`

Open scotttrinh opened this issue 1 month ago • 2 comments

As written, our current e.op implementation is O(n) on the number of separate overloads we've defined for it, which is currently in the 270ish range. That means overloads define later are more expensive. Recently, TypeScript 5.3 introduced some changes to type inference that have made this bad situation much worse. We need to find a more efficiently set of overloads for e.op that makes selecting the right overload something closer to constant (constant over the number of forms unary, binary, and ternary?) if possible.

scotttrinh avatar May 13 '24 18:05 scotttrinh