Open nyh opened 6 years ago
See also:
This command made some big improvements on the speed. Around 10x as fast.
VBoxManage setextradata VM_NAME "VBoxInternal/Devices/serial/0/Config/YieldOnLSRRead” 1
About the first link - funny, I didn't remember writing that three years ago :-)
@wkozaczuk noticed that when uploading a lot tiny files to OSv, cpiod's outputting of the file names can take up a majority of the performance: He reported that by commenting out the printouts, on OSX he measured
While we don't expect the serial port to be quick, as every character output requires an exit, perhaps can can be made not as terrible (especially on VirtualBox). I suspected that:
Two things we should investigate to help this situation:
Currently we assume that the UART has a buffer of only one character. I believe that modern UARTS actually have a larger transmit buffer, and I am guessing that both QEMU and VirtualBox supports those, and can reduce the number of context switches and silly busy loops. Looking in Linux's tty/serial/8250/8250_core.c suggests that 16550A (which I think VirtualBox provides?) may have a 16-byte output FIFO, and some sources I read suggest that qemu also has a 16-byte TX FIFO.
Currently we busy-wait until we can output another character. It might make sense to use TX interrupts instead, so that we can immediately let the host threads run (and handle the characters in the fifo). Doing this will be harder than fix 1 above, and have more potential for negative performance impact, so we should probably try fix 1 first.