Skip to content

perf(run): the up-to-date check still walks the source tree on every run (~0.85s in a large consumer) #560

Description

@MarkMichaelis

Follow-up to #519 / #546, recorded at session wrap-up so it does not live only in a conversation.

What is left

With the launch plan cached (#546), an unchanged run of a sample app costs ~0.26s, of which the application itself is ~0.10s. The largest remaining launcher cost is the up-to-date check: Test-BuildRequired walks the pruned source tree on every run to find the newest source timestamp.

Measured in a large consumer (MarkMichaelis/CodiwomplerSocialMedia, ~6k source files after pruning): ~0.85s per run, plus ~0.7s for project discovery (Find-RunnableProjects, which reads every .csproj). Those two are now most of the launcher's wall clock there.

Why it is not already solved

The walk is what makes --no-build unnecessary in the common case, so it cannot simply be dropped. #521 added a trailing --no-build that skips it when the developer knows the build is current, which is a manual escape rather than a fix.

Possible directions (none chosen)

  • Cache the discovered runnable project the way the launch plan is cached, invalidated on solution/project-file changes -- removes the .csproj-reading pass.
  • Short-circuit the timestamp walk: stop at the first source newer than the build output instead of finding the newest (needs the threshold pushed into the walk).
  • Compare against a directory-level watermark, or use the build output's own up-to-date check.

Verified vs assumed

Verified: the timings above, measured directly. Assumed: that the directions listed are feasible -- none has been prototyped.

Activity

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

    area/workflowDev loop, dispatch, sync, worktrees, instructionspriority/important-longtermP2 -- important; may not be staffed yet or may take several releases

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions