You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ecs: an idle sync point (no command issued) should cost nothing #245
A sync point where no system issued a command costs about 0.1 µs, and ordering systems with after to settle a read/write conflict creates sync points whether or not the commands fire. In a frame that is mostly idle, the sync points are most of what changed.
Measurement (mecs, Apple M3, node)
The editor's frame of input, pointer, voxel and editor systems, while a drag is held with the pointer still (drag frame select 256 / raise 256; paints nothing):
So the version alone costs nothing; three added sync points cost about 0.4 µs (13 to 27%) in a frame whose commands never fire. A synthetic chain (n systems, each after the last, each with if (flag) commands.spawn(...) that never runs) adds 0.06 to 0.17 µs per sync point.
Requested
Skip a sync point (or make it free) when no command was recorded since the last one, so a schedule that must contain the sync point for the case where commands fire costs nothing in the frame where they don't. If the cost is the tier boundary rather than the apply, say so in the guide ("sync points cost a little each").
Notes
Related to #243 (resource writer ordering): most of mecs's added after edges only settle a conflict.
Addressed in #250 (Adobe-Firefly/ecs#9). An idle sync point already applied nothing; its cost was bookkeeping, plus the tier boundary. A sync point is also planned only where an earlier system's commands could change what a later one reaches, and shared across many after edges, so not one per after.
Now a sync point with nothing to apply is skipped, and tiers that run on the world's thread run as one pass through such sync points. With eight chained systems, 100 runs a sample, seven idle sync points cost 713 ns, down from 859 ns. A tier boundary costs 14 ns (26 before), an idle sync point 11 ns (20). The guide says what an ordering costs. #246 and #243 remove most of the orderings that were only settling conflicts.
Activity
krisnye commentedon Nov 1, 2026
Addressed in #250 (Adobe-Firefly/ecs#9). An idle sync point already applied nothing; its cost was bookkeeping, plus the tier boundary. A sync point is also planned only where an earlier system's commands could change what a later one reaches, and shared across many
afteredges, so not one perafter.Now a sync point with nothing to apply is skipped, and tiers that run on the world's thread run as one pass through such sync points. With eight chained systems, 100 runs a sample, seven idle sync points cost 713 ns, down from 859 ns. A tier boundary costs 14 ns (26 before), an idle sync point 11 ns (20). The guide says what an ordering costs. #246 and #243 remove most of the orderings that were only settling conflicts.