Black Lives Matter. Please consider donating to Black Girls Code today.

Huge difference in performance

I am combining area charts with scatter charts. Initially I have 3 lines and two areas. It looks like this:

At some point I am deleting all three areas. I am using the following code:

 for (var i = 0; i < div_chart.data.length; i++) {
                        var trace = div_chart.data[i];
                        if (trace.fill === 'tozeroy') {
                            div_chart.data.shift();
                            i = -1;
                        };
                    };

Plotly.relayout(div_chart, div_chart.layout);

It works fasts enough. But if I add two more subplots first:

![Capture|690x436](upload://ka2igbA5qly7lJMEQMAPqhpA5uM.png) 

then Plotly.relayout(div_chart, div_chart.layout); will take 7-8 secs.
I tried deleteTraces, the same.

Any help?

Thanks

Cannot upload second image. :((((((((((