Closed addmix closed 1 year ago
Although freeing the arrays would make memory more stable, removing values from the x
and y
arrays in the Chart script will make you lose all your first n
values inside the Function object you are plotting.
x
and y
values are passed from the Function
object to the Chart
and FunctionPlotter
classes by reference, as well as when you provide your x
and y
arrays to the Function
object without cloning. So removing at any step a value from those array would make you lose them in your own data in your own arrays.
Since I don't want to interfere with user's data, if you care more about performances than losing your runtime data I would suggest instead to achieve the same goal by calling the Function.remove_point(0)
method before/after adding a new point.
The goal of "sampling" is to not display older values in the plot, although they are still in your data. You could always remove them manually from your own Functions.
Does it make sense to you?
Makes sense.
Samples omitted by
ChartProperties.max_samples
are not freed from memory.Values should also be removed from the Function objects as well.