From d3074636fff0fbcd5fd9b71c0c3b1c1f5c0c1285 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 13 Nov 2026 15:07:42 -0300 Subject: host: add optional Tracy profiling and reduce upload allocation stalls --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index e2d8ab6..d07a559 100644 --- a/README.md +++ b/README.md @@ -889,3 +889,21 @@ canvas, in release mode, and fails if a simple one (30 shapes) takes 1 ms to parse and draw: an equation of 8 shapes parses in 0.02 ms, draws on the CPU in 0.25 ms, and is recorded as a GPU pass in 0.02 ms (the GPU's own time is not measured). + +### Optional native profiling + +Build the host with `zig build -Doptimize=ReleaseFast -Dtracy=/absolute/path/to/tracy`. +The checkout supplies `public/TracyClient.cpp`; no profiler is downloaded or +linked by default. Linked native apps pass their `-Dtracy` option to `sketchbook.init` as +`.tracy = path` and can import `sb.modules.tracy` for their own zones: +`const zone = tracy.zone(@src(), "work"); defer zone.end();`. +The host marks frames, input polling, drawing, command painting and presentation. +These are CPU wall times (presentation includes waits), not GPU timestamps. +Use a matching `tracy-capture` or the Tracy UI. Disabled builds compile the +calls out; tests disable their zones too. The wrapper follows Pardes's small +Zig Tracy binding. Forward the same option through dependencies that also +initialize Sketchbook so the build shares one host/client module. + +ASCII text caches coverage independently of animated ink. The pinned SDL Vulkan +patch keeps memory relocation disabled and lets small transfer buffers share +allocations, avoiding hundreds of dedicated allocation frees during presentation. -- cgit v1.3