Pair sensors with readings, keep anomalies

FxDart wins

Requirement

A telemetry API returns two parallel lists: sensor names and their latest temperature readings, matched by position. Pair them up, keep the readings above 90.0 °C, and print one alert line per anomaly, in list order. The data is in the code below; both versions must print the lines shown under Expected output.

Expected output
boiler-2: 104.6 °C
pump-b: 93.4 °C
vent-7: 97.1 °C

Side by side

Native Dart

FxDart

Why they differ

Core Dart has no zip. package:collection offers IterableZip, but it zips same-typed iterables — pairing a List<String> with a List<double> degrades both to Object and puts casts in your predicate — so in practice Dart developers write the index loop shown here instead. The loop is correct, but the pairing lives in positional bookkeeping (sensors[i], readings[i]) and produces nothing you can pass along or filter further. FxDart's zip yields typed (String, double) record pairs, so the anomaly check and the formatting stay ordinary chain steps over real values.

Benchmark

Apple M1 Max, 32 GB RAM · Dart 3.12.2 (AOT-compiled) · 2026-08-24

N = 100

Time Tie

Native Dart 6.0 µs
FxDart 6.9 µs

Peak memory Tie

Native Dart 16.5 MB
FxDart 16.6 MB

N = 10,000

Time Tie

Native Dart 520 µs
FxDart 572 µs

Peak memory Tie

Native Dart 23.7 MB
FxDart 23.7 MB

N = 1,000,000

Time Native wins

Native Dart 62.5 ms
FxDart 68.2 ms

Peak memory FxDart wins

Native Dart 169.8 MB
FxDart 159.4 MB

Bars are medians of repeated timed iterations in fresh processes per side (small N is batched for timer resolution). Sides within 5% of each other — or within 0.6 ms, a difference no person can perceive — count as a tie; close relative races are re-measured up to 5 runs. In an app, anything under a few milliseconds is invisible to the user regardless of which bar is shorter. Memory is peak process RSS. The Dart VM and the dataset are identical on both sides, so the difference between the two bars is what the pipeline itself holds onto.