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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user