// the find
haoel/downsampling
downsampling time series data algorithm in Go
A Go implementation of three downsampling algorithms from Sveinn Steinarsson's 2013 thesis: LTTB, LTOB, and LTD. Aimed at reducing time series data for visualization without losing the visual shape — useful if you're storing metrics in something like Elasticsearch and want to compress historical data before archiving.
All three algorithms from the paper are implemented, not just the popular LTTB, so you can compare approaches for your data characteristics. The benchmark and profiling targets are wired into the Makefile from day one, which is more than most small libraries bother with. The demo generates a PNG comparing raw vs. all three downsampled outputs side by side — useful for quickly validating which algorithm preserves your signal best. The core package is clean and importable independently of the demo scaffolding.
Abandoned since April 2023 and hasn't seen meaningful development in years — the author (haoel) passed away in 2023, so this repo will likely never be maintained again. The API surface is minimal to the point of being bare: no streaming support, no option to downsample by time bucket rather than fixed point count. No goroutine-safe usage notes, which matters if you're calling this from concurrent metric collectors. The algorithms operate on a custom `Point` struct rather than accepting `[]float64` pairs or `time.Time` x-values, so integrating with standard Go time series types requires adapters.