Juno FDxICSP 1.1 - Maximum upload speed - AVR910 Protocol deeper look AVRdude AVR Programmer
Block mode or burst mode. Serial data are sent in a burst of page-size, so it's critical that the programmer can respond and receive the block data package. Delay in between command is okay, but not during the burst transfer.
PS. 3.6k Byte/s upload on a t13 had been achieved, while 6200 byte per second is the absolute maximum speed.
Serial 1000000 bps, it takes 1/(1000000/10)=0.00001s or 10us to send one byte via UART;
SPI 4000000 MHz, it takes 1/(4000000/(4*8))=0.000008s or 8uS to send one byte via SPI;
4.5 ms to write one page, so
Absolute Max upload speed:
(0.0045+(32*0.00001)+(32*0.000008)+((3+5)*0.00001)=0.005156s to write 32 bytes or 32/0.005156=62,06 byte/s for 32-byte MCU;
(0.0045+(64*0.00001)+(64*0.000008)+((3+5)*0.00001)=0.005732s to write 64 bytes or 64/0.005732=11,165 byte/s for 64-byte MCU;
(0.0045+(128*0.00001)+(128*0.000008)+((3+5)*0.00001)=0.006884s to write 128 bytes or 128/0.006884=18,593 byte/s 128-byte MCU;