Skip to content

Choose the times to sample in the report more wisely

Philip Elson requested to merge pelson/cara:feature/better_plot_sampling into master

Instead of sampling 600 times between the start and end of the model, we now take the key moments in state change, and augment them with points if they are further than a certain distance appart. In this way, we can easily build a list of 100 times which hit key moments for the model, and which are at a suitable resolution to produce good quality graphics.

Before:

Screenshot_from_2021-08-10_17-02-54

After:

Screenshot_from_2021-08-10_17-02-38

In terms of performance, the improvement continues to be quite significant:

Before:

[I 210810 16:58:54 web:2250] 200 POST /calculator/report (::1) 2824.31ms
[I 210810 16:59:05 web:2250] 200 POST /calculator/report (::1) 1317.41ms

After:

[I 210810 16:59:19 web:2250] 200 POST /calculator/report (::1) 2433.05ms
[I 210810 16:59:23 web:2250] 200 POST /calculator/report (::1) 878.38ms

Merge request reports