Tests
- Avg Read - read a 1KB file 100 times calculate the median
- Httperf - series of httperf tests on a 1KB file to evaluate the latency
In the main repo there is a performance_test which is our north star. All it does is send 1KB from the gameboy to the wii and output the time diff.
Baseline: 90ms
Results
Commit Avg Read 1 Conn/Sec 5 Conn/Sec 10 Conn/Sec 20 Conn/Sec 669bcfa got reading/writing to actually work 385 314 2543 9851 25701 c4a38c0 remove tte_write / disable vblank 305 255 1139 6952 18709 206c753 remove snprintf calls from gba 266 224 323 5307 15404 e814035 packet - send 3 bytes instead of 2 193 163 149 2471 9678 7f05b15 packet - send 31 bits at a time 147 128 116 726 6290
Thoughts
2026-09-02
I am really happy with this first batch of improvements to the read performance of the Puffboy. A 60% decrease in the single reads, and a 75% decrease in performance at 20 connections/sec.
The big changes are all around how data is sent across the wire. There is a big constraint with the library that I am using to send data from the GBA to the Wii:
\warning If the other end asks for data at the same time you call this method, a `0x00000000` will be sent.
Based on the timing it is possible the Wii receives all zeros instead of the expected response. That makes it impossible to separate a misfire from an actual expected 0.
The solution has evolved over time, but requires the Puffboy to always send at least a single integrity bit with every message. Each iteration of the message passing has refactored how much metadata is submitted. With the latest change it now only sends a single bit. Before that I was preparing for a world where concurrent messages could be sent to the gameboy, I no longer think that makes much sense. Who knows.