Optimize buffer operations for better upload performance

- Replace byte-by-byte copies with memcpy (10-100x faster)
- Increase SD write chunk size from 4KB to 16KB
- Use static buffer for SD writes to reduce stack usage
- Remove unnecessary yield() from handleClient loop

The byte-by-byte circular buffer operations were a major bottleneck.
Using memcpy with proper wrap-around handling significantly improves
throughput.
This commit is contained in:
Claude
2026-01-10 21:02:38 +00:00
parent cc666e5c18
commit 953df1f3f9
2 changed files with 25 additions and 12 deletions

View File

@@ -327,7 +327,6 @@ void CrossPointWebServerActivity::loop() {
// in chunks and each handleClient() call processes incoming data
for (int i = 0; i < HANDLE_CLIENT_ITERATIONS && webServer->isRunning(); i++) {
webServer->handleClient();
yield(); // Allow other tasks to run between iterations
}
lastHandleClientTime = millis();
}