pyboard.py very slow on windows, reason and solution
I have recently adopted my µPIDE Micropython IDE to use pyboard.py for remote communication. I soon noticed that transfers from the device to the host are 5 times slower under Windows 10 than under Linux. My previous own version did not have such an issue,
It turned out that serial.inWaiting() is awfully slow on Windows 10 and it's being called for every single byte that's being read via read_until().
As a solution I wrote a little buffering serial wrapper.
https://github.com/harbaum/upide/blob/main/src/buffered_serial.py
This can be used in pyboard.py like import buffered_serial as serial in https://github.com/micropython/micropython/blob/0a217624e1d26899986d3e79eb604652da540b00/tools/pyboard.py#L268
This avoids calling inWaiting() permanently and as a result pyboard.py's read performance now feels similar to Linux.
P.S.: This is not yet included in a µPIDE release, so the latest v1.1.0 still shows that slowness.
USB problem with Windows
There have been so far 2 independent reports of a "flaky" serial device on the pyboard. The pyboard works, and the mass storage device appears. The serial driver can be installed and the pyboard is recognised by windows, but the terminal program (eg PuTTY) does not work, or at least works only occasionally. One solution seems to be asserting DTR in the terminal program, if possible.
We need to collect more information about this.