I’m really happy to see these detailed suggestions & improvements, they’re really useful.
Squiggle is still an early language, there are definitely a lot of fixes for things like these to be done.
Quick question: > This is the primary reason I wasn’t able to completely verify the Squiggle model against Causal
Any harder numbers here would be really useful, to get a better sense. I just looked at this model, which takes me a few seconds to render. (This is also too much to be done each keystroke, similar to Squiggle). I’d expect Squiggle to be slower than Causal (for one, Squiggle is much newer and not a startup), but I’m of course curious how much it is.
Calculating up to annually_averted_health_dalys_time_discounted was taking me well over a minute in v0.3.0, but is down to ~5 seconds in v0.3.1--a big improvement!
I originally had to comment the actual model output (dollars_per_daly_equivalents_averted(20)) because it wouldn’t return at all in v0.3.0, but now it’s ~2 mins in v0.3.1.
For reference, the whole Causal model takes ~5 seconds to update.
I also noticed that your definition of the “clip” function was fairly inefficient. If you use the built-in “truncate” function instead, time is shaved to 15 seconds in the latest version.
Happy to report that it’s now ~3s using the truncate function, and ~7s using the original code (though they have slightly different functionality, one crops the function and the other one moves all the points outside the range into the nearest point in the range).
I’m really happy to see these detailed suggestions & improvements, they’re really useful.
Squiggle is still an early language, there are definitely a lot of fixes for things like these to be done.
Quick question:
> This is the primary reason I wasn’t able to completely verify the Squiggle model against Causal
Any harder numbers here would be really useful, to get a better sense. I just looked at this model, which takes me a few seconds to render. (This is also too much to be done each keystroke, similar to Squiggle). I’d expect Squiggle to be slower than Causal (for one, Squiggle is much newer and not a startup), but I’m of course curious how much it is.
Calculating up to
annually_averted_health_dalys_time_discounted
was taking me well over a minute in v0.3.0, but is down to ~5 seconds in v0.3.1--a big improvement!I originally had to comment the actual model output (
dollars_per_daly_equivalents_averted(20)
) because it wouldn’t return at all in v0.3.0, but now it’s ~2 mins in v0.3.1.For reference, the whole Causal model takes ~5 seconds to update.
Now down to 1 min (55 seconds) in v.4. My guess is it’s the maps and reduces, we should look whether we can optimize their implementation.
I also noticed that your definition of the “clip” function was fairly inefficient. If you use the built-in “truncate” function instead, time is shaved to 15 seconds in the latest version.
Happy to report that it’s now ~3s using the truncate function, and ~7s using the original code (though they have slightly different functionality, one crops the function and the other one moves all the points outside the range into the nearest point in the range).