Urgent.News

What's breaking now, across thousands of outlets.

Tech

I Added Every Index, but My Telemetry Pipeline Was Still Quadratic

A 15-minute drone flight is 9,000 GPS points. My telemetry ingest ran 40 million distance calculations to track one number. No index could fix it.

I Added Every Index, but My Telemetry Pipeline Was Still Quadratic

The telemetry pipeline for the FLYON web platform was performing poorly, despite the addition of indexes. The pipeline processed live telemetry from a ground station, drew the flight on a map, warned users of no-fly zones, and scored the flight afterwards. The ground bridge, a Python process, sent 9,000 points per 15-minute flight at a rate of 10 Hz.

This meant 9,000 distance calculations per flight to maintain a running total. The core issue was in the updateFlightStats function, which recalculated the entire flight every time a new point arrived, leading to a quadratic time complexity (O(N²)) for the flight. Measuring the performance, the original approach averaged 138.9 seconds for a 9,000-point flight, while the incremental approach reduced this to 11.2 seconds.

This meant a single server thread could only handle about 38 points per second, severely limiting the capacity to handle multiple concurrent drones. The performance was acceptable at lower point rates, but degraded significantly as the flight duration increased, leading to a smooth and unnoticed degradation until the live map started lagging behind the drone around the 12-minute mark.

Written by urgent.news from HackerNoon's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at hackernoon.com →

More in Tech

More from Tuesday 6 October →