Interactive line chart visualizations greatly enhance the effective exploration of large time series. Although downsampling has emerged as a well-established approach to enable efficient interactive visualization of large datasets, it is not an inherent feature in most visualization tools. Furthermore, there is no library offering a convenient interface for high-performance implementations of prominent downsampling algorithms. To address these shortcomings, we present tsdownsample, an open-source Python package specifically designed for CPU-based, in-memory time series downsampling. Our library focuses on performance and convenient integration, offering optimized implementations of leading downsampling algorithms. We achieve this optimization by leveraging low-level SIMD instructions and multithreading capabilities in Rust. In particular, SIMD instructions were employed to optimize the argmin and argmax operations. This SIMD optimization, along with some algorithmic tricks, proved crucial in enhancing the performance of various downsampling algorithms. We evaluate the performance of tsdownsample and demonstrate its interoperability with an established visualization framework. Our performance benchmarks indicate that the algorithmic runtime of tsdownsample approximates the CPU's memory bandwidth. This work marks a significant advancement in bringing high-performance time series downsampling to the Python ecosystem, enabling scalable visualization. The open-source code can be found at https://github.com/predict-idlab/tsdownsample
翻译:交互式折线图可视化极大地增强了对大规模时间序列的有效探索。尽管降采样已成为实现大数据集高效交互式可视化的成熟方法,但大多数可视化工具并未将其作为原生功能。此外,目前尚缺乏提供便捷接口以集成主流降采样算法高性能实现的库。为弥补这些不足,我们提出tsdownsample——一个专为基于CPU的内存时间序列降采样而设计的开源Python包。该库聚焦性能与便捷集成,提供领先降采样算法的优化实现。我们通过利用Rust中的底层SIMD指令与多线程能力实现优化,特别是采用SIMD指令优化argmin与argmax操作。该SIMD优化结合若干算法技巧,被证明是提升多种降采样算法性能的关键。我们评估了tsdownsample的性能,并展示了其与成熟可视化框架的互操作性。性能基准测试表明,tsdownsample的算法运行时间已接近CPU内存带宽上限。这项工作标志着将高性能时间序列降采样引入Python生态系统的重大进展,实现了可扩展的可视化。开源代码详见https://github.com/predict-idlab/tsdownsample