Closed amosr closed 6 years ago
Seems reasonable, what's the story here?
the conversion to ANF is renaming way more variables than it needs to, and we should be able to take advantage of the fact that the input program never has shadowing, in order to limit renaming variables.
but this implementation is wrong, I just found a case which fails:
let a = (let b = 0 in b + 1)
\b. a + b
==>
let b = 0
let a = b + 1
\b. a + b
actually, it wasn't the renaming that was taking so long, it was the fact that the bookkeeping for what to rename was done in a separate pass, as well as converting a list to a set on every iteration.
A fact with 200 int fields
feature ints200 ~> group a1 ~> latest 1 ~> fields
45.2s -> 3.44s
!!!
45.2s -> 3.44s
Wow!!
yeah, it's crazy!
I can only imagine how bad it is for a 500 field struct
let's find out!
feature ints500 ~> group a1 ~> latest 1 ~> fields
918.87s -> 31.56s
unreal
Winning, going to make a huge difference
:100:
/jury approved @jystic