• src/doors/syncduke/Engine/src/filesystem.c

    From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Fri Jun 26 22:40:09 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/a22754e15f142c3c002c4767
    Modified Files:
    src/doors/syncduke/Engine/src/filesystem.c
    Log Message:
    syncduke: load the GRP into RAM so lump reads don't round-trip over SMB

    The Build engine read each GRP lump via unbuffered 2-4 byte read()s (kread16/32/8 -> kread -> lseek+read), relying on the OS file cache to make them cheap. That holds on local disk but not over a network share: on an SMB-mounted install every tiny read round-trips to the file server, so door startup (CON compile, art/palette load) took ~13.7s vs ~3.2s on local disk.

    Slurp the read-only GRP into RAM once at initgroupfile() (folding in the existing CRC32 pass) and serve each lump kread() via memcpy; fall back to the fd path if the allocation fails. The original authors clearly intended this (the commented-out groupfil_memory malloc and the "caches the GRP in memory" note). SMB startup now matches local disk (~3.2s); local is unchanged.

    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net