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

    From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sun Jul 5 03:53:27 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/70a6778ad0784b8d5dca5fee
    Modified Files:
    src/doors/syncduke/Engine/src/filesystem.c
    Log Message:
    syncduke: slurp kopen4load() filesystem files into RAM (user-map load)

    Loading a third-party user map over a no-oplock SMB share took minutes: loadboard() reads the .map one 1-4 byte field at a time (~211k kread()
    calls for Roch.map's 1023 sectors / 8027 walls / 2251 sprites), and for
    a SYSTEM_FILE each kread() was an unbuffered read() syscall -- a full
    network round trip when client-side caching is disabled (no
    oplocks/leases), so the door sat "frozen" on the ENTERING USER MAP
    screen for a couple of minutes.

    Apply the same cure initgroupfile() already applies to GRPs: slurp the (read-only) file into RAM at kopen4load() time -- capped at 16MB -- and
    serve kread/klseek/kfilelength from the buffer; fall back to the fd
    path when the file is over-cap or the slurp fails. Stock levels never
    hit this (they live inside the in-RAM GRP); only -map user maps read
    via the filesystem. Measured: Roch.map cold start went from 2-3
    minutes to 3.7 seconds (~211k read syscalls down to 7).

    Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

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