The same iterative job (like training a model — many passes over the same data) run two ways.
Hadoop MapReduce writes to disk between every step. Spark loads once and keeps the
data in memory. Watch the gap grow as you add iterations.
Hadoop MapReduce disk between every step0.0s
Apache Spark load once, stay in memory0.0s
Disk read/write (slow) Compute (map/reduce) In-memory pass
Why the gap: RAM is roughly 100× faster than disk. Hadoop pays a full disk
round-trip between every stage, so the cost piles up with each iteration. Spark reads from disk once,
then keeps the working data in memory across all passes — which is why it's famously 10–100×
faster on iterative jobs like machine learning. (Times here are illustrative, scaled so one animation second
≈ a whole phase.)