Two feeds, strictly in order
Requirement
An incident review needs the tail of yesterday's log followed by today's log as one numbered list — today's first entry must never appear before yesterday's last. The data is in the code; both versions must print the lines shown under Expected output.
Expected output
1. 23:41 cache flushed 2. 23:52 nightly backup started 3. 23:58 nightly backup finished 4. 00:04 cache warmed 5. 00:12 first request served 6. 06:30 daily report generated 7. 07:02 queue drained
Side by side
RxDart
FxDart
Why they differ
Both libraries write "this feed, then that one" as a single operator,
but each model guarantees the order with its own mechanism. RxDart's
concatWith is a subscription sequencer: it
doesn't subscribe to today's stream until yesterday's fires
done, so ordering holds even if both sources are live
and today's would have been ready to emit earlier. FxDart's
concat is a demand sequencer: the chain pulls
from the second iterable only after the first is exhausted, and
with two in-memory lists that is all the ordering there is to
arrange.
That mechanism gap matters exactly when the sources are genuinely
push-driven — a stream that starts emitting the moment it is
subscribed needs concatWith's deferred subscription,
where a pull pipeline would first have to buffer the not-yet-wanted
feed. Over fixed data the two collapse into the same seven lines and
the same map. A tie: the operator is shared vocabulary,
and each model implements it with the tool it already had.
Benchmark
N = 100
Time Tie
Peak memory Tie
N = 1,000,000
Time FxDart wins
Peak memory Tie
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.