Commit Graph
3 Commits
Author SHA1 Message Date
Anees Iqbal 5fc13039ec 🆕 Time a retain right after a setVertexBytes in encode_probe
A locked instruction right after a store to a write-combined page waits for
the page's write-combining buffers to drain, which may cost ~90 ns on an AMD
host where the guest's write-combined mappings stay write-combined. setBytes
copies its bytes into a write-combined upload chunk, so the new case
render.setVertexBytes.16.retained follows each 16-byte setVertexBytes with a
CFRetain and a CFRelease, to set against render.setVertexBuffer.retained's
cost of the same two locked instructions after a write-back store.
2026-11-13 12:38:11 -08:00
Anees Iqbal 6f27b78d53 🆕 Time a bind wrapped in a retain and a release in encode_probe
An app's reference counting may wrap an encoder call in a retain and a
release of its argument, two locked instructions on the encoding thread.
render.setVertexBuffer.retained times setVertexBuffer:offset:atIndex: so
wrapped, to set what they cost in a guest against a real Mac.
2026-11-12 16:14:00 -08:00
Anees Iqbal f187cc950f 🆕 Add encode_probe, the hot encoder calls' cost in ns a call
Nobody knows what the guest's Metal bundle costs the guest's CPU per Metal
call against a real Mac's Metal: the host's per-draw cost is measured, the
guest's share is not. encode_probe times runs of one encoder call each
(buffer, bytes, texture, sampler and pipeline sets, draws, compute sets and
dispatches, encoder make and end, command buffer make and commit) and prints
ns a call from wall and thread CPU time, so a guest and a real Mac run the
same binary and compare call by call.
2026-11-12 16:14:00 -08:00