4 ms·
There was a fun example in the Julia compiler around a year ago. Part of the compiler was O(N^2) in `let` block nesting depth. That is let x = foo(), y = y,
by celrod 4y ago
There was a fun example in the Julia compiler around a year ago.
Part of the compiler was O(N^2) in `let` block nesting depth. That is
let x = foo(), y = y, z = 2y
...
end
would be a depth of 3. It didn't seem like that should be a problem, N is never going to be 10, let alone 100, right?
Until suddenly, `N` was in the thousands in some critical generated code spit out by some modeling software, so that handling the scoping introduced by `let` suddenly dominated the compilation time...