Skip to content

ecs: an idle sync point (no command issued) should cost nothing #245

Closed

Description

@krisnye

Summary

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):

tiers sync points raise 256
mecs before the update, @adobe/ecs 0.2.3 3 1 2.83 µs
same code, @adobe/ecs 0.2.4 3 1 2.83 to 3.04 µs (same)
mecs now (orderings added for #232's semantics) 6 4 3.25 to 3.46 µs

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.

Activity

  1. krisnye commented on Nov 1, 2026

    @krisnye
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions