删除大量系列可能会很慢

作者: Vimiso创建于 2026年1月19日更新于 2026年1月19日

`v5` - removing lots of multiple series is slow. The functionality is when I change timeframe I want to load new plots to fit that timeframe. These plots are split over multiple series so that they have their own unique lines. Performance is fine drawing them and the chart is very responsive once they're drawn, even when there are hundreds or even thousands. However, when it comes to tearing them down using `removeSeries` it takes a while, this blocks the main thread in my app until they've finished being removed - which is not ideal. But I kind of have to remove them because there might be more or less plot available on a new timeframe. Here's the code in a React context:

内容来源: tradingview/lightweight-charts