TimeWarp.Examples.Spin (TimeWarp v0.1.0)

Copy Markdown View Source

A synthetic per-fold compute cost for the eager-vs-buffered stream experiment.

It must be PURE — handle_event/3 is double-call purity-probed, so a wall-clock spin would be caught and would also break determinism. So burn/1 is a fixed n-iteration arithmetic loop: deterministic (same result every call), no wall-clock, cost roughly linear in n. n is the knob c — compute units per event, not microseconds — and it is identical work in both models, so the only thing that differs between them is WHERE that work runs relative to GVT.

Summary

Functions

burn(n)

@spec burn(non_neg_integer()) :: non_neg_integer()