このページはまだ翻訳されていないため、英語で表示されます。 翻訳に参加する

Two feeds, strictly in order

Toss-up

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

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

N = 100

Time Tie

RxDart 24 µs
FxDart 9.6 µs

Peak memory Tie

RxDart 16.5 MB
FxDart 16.6 MB

N = 1,000,000

Time FxDart wins

RxDart 217.2 ms
FxDart 126.0 ms

Peak memory Tie

RxDart 268.6 MB
FxDart 275.9 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.