From 9ee682344f4de3b081f396c7c67693ba76773492 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 15 Nov 2026 08:14:44 -0800 Subject: [PATCH] FAST-PATHS: the 16 KiB allocation's measured cost A 16385-byte buffer's VkBuffer requires 32768 bytes where 16400 did, on RADV PHOENIX and lavapipe (m3-max-32595, m3-max-32558). On the Radeon 780M, release, exclusive, the base (d2ee5bca5b) and this tree run twice each in one job (m3-max-32595): 1000 buffers of 16 KiB + 1 to 4 MiB required 763.3 MB against 754.8 MB and took one more 64 MiB block in their second round; making them took the same time within the runs' spread, Shared ones cleared on the host and Private ones' first fills alike. --- docs/FAST-PATHS.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/FAST-PATHS.md b/docs/FAST-PATHS.md index 4ea782d5a..62738a6e7 100644 --- a/docs/FAST-PATHS.md +++ b/docs/FAST-PATHS.md @@ -577,7 +577,14 @@ recorded here. more than its length, which its first fill clears with the rest (the host's clear of a `Shared` or `Managed` buffer, the device's fill of a `Private` one, `Buffer::clear_first`), with no command of its own. A heap's buffer, a no-copy, wrapped or exportable buffer, and every buffer - under 16 KiB take their length. + under 16 KiB take their length. A 16385-byte buffer's `VkBuffer` requires 32768 bytes where its + 16400 bytes did before, on a Radeon 780M (RADV PHOENIX) and on lavapipe alike. On the Radeon + 780M, 1000 buffers of 16 KiB + 1 to 4 MiB spread geometrically, 754.8 MB of lengths + (`tests::buffer_making_bench`, release, `Shared` then `Private`, five rounds each, two runs of + each tree in one job), required 763.3 MB against 754.8 MB (1.13% more) and took one more 64 MiB + block in their second round; their making took the same time within the runs' spread: `Shared` + ones, cleared on the host, 92-97 ms cold and 27-35 ms warm against 92-99 and 27-36 ms; `Private` + ones 1.0-6.0 ms against 1.0-6.1 ms, and their first fills 10.7-13.1 ms against 10.4-12.1 ms. - **A command buffer's copies in and new buffers' fills come after the work before it**, as Metal's copy of a `Managed` buffer's modified range and a new buffer's contents come before the commands that take them and after those before. On a device whose family of transfers alone has two queues