Skip to content

Speed up SMB shared-folder transfers#370

Merged
felixrieseberg merged 1 commit into
mainfrom
claude/wizardly-elgamal
Apr 14, 2026
Merged

Speed up SMB shared-folder transfers#370
felixrieseberg merged 1 commit into
mainfrom
claude/wizardly-elgamal

Conversation

@felixrieseberg
Copy link
Copy Markdown
Owner

SMB copies were much slower than ISO copies. Three independent causes:

1. Stop-and-wait TCP. v86's userspace TCP sends one 1460-byte segment then blocks on pending=true until the guest ACKs. Combined with Win95's delayed-ACK, a 64K READ_RAW becomes ~45 emulated round-trips. setupSmbShare now overrides pump() per-connection to keep a window of segments in flight (up to the guest's advertised rwin, capped at 8×MSS so we never overrun the NE2000 RX ring). The link is in-process and lossless — and the original stack has no retransmit anyway — so this is safe.

2. Per-byte reply assembly. buildSmb() and coreRead() pushed every payload byte into a JS number[] then re-copied — ~32K Array.push calls per 16K read. Both now allocate one Uint8Array and set() the payload.

3. Hot-path diagnostics. The net0-send frame counter and the console.logappendFileSync tee ran unconditionally on every frame. Both are now gated behind WIN95_SMB_LOG.

ISO will always win (ATAPI is readSync → guest RAM with no protocol/NIC layer), but the windowing should make SMB severalfold faster.

Typecheck clean; all 57 SMB protocol tests pass. The new buildSmb is byte-identical to the old Writer-based one (verified by diff + parseSmb round-trip).

@felixrieseberg felixrieseberg merged commit b14ea86 into main Apr 14, 2026
8 checks passed
@felixrieseberg felixrieseberg deleted the claude/wizardly-elgamal branch April 14, 2026 23:42
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