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).
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).