Skip to content

feat(zmodem): accelerate upload and download transfers - #3147

Open
lswzw wants to merge 1 commit into
binaricat:mainfrom
lswzw:feat/zmodem-transfer-acceleration
Open

feat(zmodem): accelerate upload and download transfers#3147
lswzw wants to merge 1 commit into
binaricat:mainfrom
lswzw:feat/zmodem-transfer-acceleration

Conversation

@lswzw

@lswzw lswzw commented Aug 25, 2026

Copy link
Copy Markdown

直接粘贴以下内容:

## Summary

Implement ZMODEM upload and download acceleration for Netcatty by reducing per-byte array processing and payload allocations.

## Type of Change

- [ ] Bug fix
- [x] New feature
- [ ] Refactor / code cleanup
- [ ] Documentation update
- [ ] Build / CI change
- [ ] Other (please describe):

## Related Issue (optional)

N/A

## Changes Made

- Add Buffer/Uint8Array fast paths for ZMODEM receive and send data.
- Add typed-array CRC16/CRC32 processing and zero-copy download payload handling.
- Reduce upload allocation overhead with direct frame encoding and larger read chunks.
- Throttle upload progress events across transports.
- Improve ZMODEM send-session keepalive and handshake handling.
- Add `NETCATTY_ZMODEM_FAST_PATH=0` to disable both performance paths for troubleshooting.
- Add receive-path regression and protocol-equivalence tests.

## Screenshots / Demo

N/A - terminal transfer performance change.

## Testing

- [ ] I have tested these changes locally (`npm run dev`) (not applicable; no UI changes)
- [x] Linting passes (`npm run lint`)
- [ ] Tests pass (`npm test`) (targeted tests pass; full suite is blocked by the existing unmatched glob `electron/capabilities/*/*/*.test.cjs`)
- [x] Generated capability tool specs are updated when applicable (not applicable)
- [x] No new console errors or warnings, if this affects app behavior

Additional verification:

- Targeted ZMODEM and bridge tests: 4/4 passed.
- Receive parser benchmark: approximately 101 MB/s on local test data.
- `node --check` and staged diff checks passed.

## Checklist

- [x] My code follows the existing project style
- [x] I have added or updated relevant documentation (inline implementation comments)
- [x] I have not introduced any breaking changes (the fast receive payload is intentionally `Uint8Array` internally for zero-copy handling)

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