icicle-lang / icicle-ambiata

A streaming query language.
BSD 3-Clause "New" or "Revised" License
57 stars 11 forks source link

a big bucket of small optimisations #654

Closed amosr closed 6 years ago

amosr commented 6 years ago
  1. A while ago I changed meltType to return a "logical melt" which distinguishes between ints as values and ints as tags (as well as errors as tags). This is because relation primops need to sort them differently. Turns out that most of the uses of meltType don't care and convert straight back to the representation type, so it's silly to construct the intermediate logical type. So I hand-specialised the function to generate the types.

  2. simpEvalX was trying to deconstruct and take the arguments of a primitive application at every point. If you had a multiple arguments you would end up trying takePrimApps, then recursing down into the function half, finding another application, and trying to takePrimApps again. Even though the previous one failed. So instead, introduce a function for recursing into applications, which takes the list of arguments you've already seen. Then when you get to the bottom, if it's a primitive you can use the argument list you've built and simplify. Otherwise just rebuild the application.

feature ints500 ~> group a1 ~> latest 1 ~> fields

Flatten Avalanche only:
30.07s -> 25.54s

! @jystic @tranma

amosr commented 6 years ago

hold on

amosr commented 6 years ago

I accidentally pushed this to master, but I was going to merge it anyway. so I'm going to leave it as-is rather than bumblingly trying to fix it.

amosr commented 6 years ago

yolo