Skip to content

Commit bf59ec9

Browse files
committed
perf(serial): improve throughput test stepping and failure handling
- Change size stepping from 2x to 1.4x with even rounding for finer granularity (16→22→30→42→58→80→112→156→218→304→424→592→828→...→3174) - When minimum size (16 bytes) fails, report as error instead of recommending 16 bytes as chunk size - Set recommended_chunk_size to 0 on total failure
1 parent a96f1f9 commit bf59ec9

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Tools/WebServer/core/serial_protocol.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ def test_serial_throughput(
630630
break
631631

632632
results["tests"].append(test_result)
633-
test_size *= 2
633+
test_size = max(test_size + 2, int(test_size * 1.4) // 2 * 2)
634634

635635
results["max_working_size"] = max_working
636636
if max_working > 0:
@@ -640,7 +640,12 @@ def test_serial_throughput(
640640
if results["recommended_chunk_size"] < 16:
641641
results["recommended_chunk_size"] = max_working
642642
else:
643-
results["recommended_chunk_size"] = 16
643+
results["success"] = False
644+
results["error"] = (
645+
"Serial communication failed at minimum size "
646+
f"({start_size} bytes). Check connection and try again."
647+
)
648+
results["recommended_chunk_size"] = 0
644649

645650
except Exception as e:
646651
results["success"] = False

Tools/WebServer/static/js/features/fpb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function fpbTestSerial() {
4545
return;
4646
}
4747

48-
log.info('Starting serial throughput test (x2 stepping)...');
48+
log.info('Starting serial throughput test (x1.4 stepping)...');
4949

5050
try {
5151
const res = await fetch('/api/fpb/test-serial', {

0 commit comments

Comments
 (0)