Files
metal2vulkan/crates
Anees Iqbal 6f882ce2bb WorkCounts time each commit call, phase by phase
reims measured CommandBuffer::commit_and_submit holding their commit thread ~30 ms (p50) per
command buffer before submission starts. The program's commit, commit_and_submit and
commit_failed calls now run under a clock of their thread (commit_times.rs), which counts the
call (WorkCounts::commit_calls), its whole time (commit_nanos) and each phase's own time, every
phase timed apart from the phases inside it so they sum to at most the whole:
- commit_lowering_nanos: settle_end_committing, the render encoders' calls left to the lowering
  thread lowered on this one, and the carried draw let go;
- commit_recording_nanos: Deferred::prepare of the work its encoders left to the commit;
- commit_pipeline_wait_nanos: that recording's wait_made for a render pass's draw pipelines;
- commit_lock_wait_nanos: submit_at_commit taking the scheduler's lock (pass_once_then, and
  pass_again after a check);
- commit_pass_nanos: the pass under the lock and its bookkeeping, its submissions apart;
- commit_submit_nanos: submit_batch on the committing thread, and the submission checks and
  handlers it ran (a commit a handler makes is counted there and as a call of its own).
Outside a commit call (the scheduler's thread, the lowering thread) a phase costs one read of a
thread-local and times nothing; nothing is timed per draw or per command.

Test: tests::commit_and_submit::a_commit_call_is_timed_phase_by_phase_within_its_whole.
api_signatures blessed (8 fields); README names the counters.
2026-11-12 07:35:25 -08:00
..