summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-13 15:07:42 -0300
committerGabriel Schneider <[email protected]>2026-11-13 15:07:42 -0300
commitd3074636fff0fbcd5fd9b71c0c3b1c1f5c0c1285 (patch)
tree918d67acc8f00f72cc4ae1ba444e41238a689c2b /README.md
parent409c1accefeb7a775c0914c888b469a1e78fc69a (diff)
downloadsketchbook-main.tar.gz
sketchbook-main.zip
host: add optional Tracy profiling and reduce upload allocation stallsHEADmain
Diffstat (limited to 'README.md')
-rw-r--r--README.md18
1 files changed, 18 insertions, 0 deletions
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.