Skip to content

Conversation

@bylaws
Copy link
Collaborator

@bylaws bylaws commented Dec 29, 2025

A significant proportion of time with the prior approach was spent in the unbuffered write calls used once per code page/entrypoint; taking upwards of 15 seconds to serialize a 700MB P3R cache. Switching to an mmap approach reduces the CPU time there to less than a second, leaving I/O to dominate.

A two-pass approach is used:

  1. Calculate the required size for the cache file, issue a callback to frontend to map a cache file of that size.
  2. Write cache data into the buffer provided by that callback.

CC: @neobrain needs linux testing

A significant proportion of time with the prior approach was spent in
the unbuffered write calls used once per code page/entrypoint; taking
upwards of 15 seconds to serialize a 700MB P3R cache. Switching to an
mmap approach reduces the CPU time there to less than a second, leaving
I/O to dominate.

A two-pass approach is used:
1. Calculate the required size for the cache file, issue a callback to
   frontend to map a cache file of that size.
2. Write cache data into the buffer provided by that callback.
@bylaws bylaws marked this pull request as draft December 29, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant