Closed tfeng closed 5 years ago
I don't know the reason that we're reading 256 bytes, but reading the exact number seems a bit error-prone (what if the prompt changes)? Would it be possible to read bytes one by one (or some small number) until we've gotten the full prompt, and then stop reading?
I'm going to merge this and hope MicroPython doesn't change their prompts, as the speedup is significant. Thank you.
On second thought, trying to test this I get failures to connect. I will need to investigate more before merging, sorry.
I've implemented this, since the failures were unrelated. Let's see if anything breaks, thank you.
It seems we are unnecessarily reading more data from the server than necessary. This results in long wait time before the prompt shows up. I tested with the actual amount of data being read from the server, and it turns out that reading 256 bytes at both places is excessive.
Can we change to the actual numbers of bytes expected in both cases?
Let me know if there is a good reason for reading 256 bytes instead.