diff options
| -rw-r--r-- | README.md | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -597,7 +597,18 @@ object. - **Hot reload.** It watches the library file and loads each new build through a symlink with a fresh name (a build must replace the file, as `zig build` - does, not rewrite it in place). + does, not rewrite it in place). `zig build lib --watch -fincremental + --debounce 0` makes a reload take tens of milliseconds instead of a second: + Zig recompiles only what the edit changed, and starts as soon as a file is + saved instead of 50 ms later. Its limits, with Zig 0.17.1: the incremental + linker is new, and a library of it that does not link libc loads only + through a host workaround that Zig 0.18 makes unnecessary; if a reload ever runs code other than what you + wrote, stop the watch and rebuild without `-fincremental`. The library is + larger (27 MB instead of 10 for a small sketch), the watching compilers + stay in memory (about 300 MB for a small sketch, 1.3 GB for a game with C + and shaders), and a save that touches several files may build more than + once. The cache grows with each start of the watch (65 MB for a game), + not with edits. - **State file.** `<name>.state` holds the live state plus 7 snapshot slots, shared via `MAP_SHARED`. Its header carries the reflected layout, so a layout change migrates every slot field by field, with enums matched by tag |
