hashc icon indicating copy to clipboard operation
hashc copied to clipboard

tc: exp-time whilst running analysis on this chunk

Open feds01 opened this issue 1 year ago • 0 comments

The following snippet (with the addition of more + 1) causes the compiler to exhibit exponential compile times (specifically in the analysis phase).

main := () => {
    y := 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
         1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1;
} // 170ms

The above snippet took 170ms to evaluate, and the one below took 310ms, and the one after 600ms:

main := () => {
    y := 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
         1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
         1;
} // 310ms
main := () => {
    y := 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
         1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
         1 + 1;
} // 600ms

feds01 avatar Sep 17 '23 03:09 feds01