dylan-smith / DiveIntelligence

1 stars 1 forks source link

Optimize `DiveProfile.getCeilingError()` #217

Open dylan-smith opened 5 days ago

dylan-smith commented 5 days ago

Currently it loops through every time step every time it's called. Can instead calculate it only when the segments change, and only from the changed segment until end of dive.

Could also defer the calculation until getCeilingError is called, and just invalidate the memoized copy when segments change.