Performance - #13
Conversation
sync with nfd/spi-flash-programmer
switch read to binary data transmission (read 30% better read performance) swith write to binary data transmission
serial connection has a 1 second timeout implementation does 3 tries anyway -> 3 seconds timeout write performane +80%
|
I am open for a discussion. |
|
I like the idea and I'm glad you left the option to read and write using hex in there, but _readPageBinary and _writePageBinary are very similar to _readPage and _writePage -- and those themselves are pretty complex functions, so that's quite a bit of copy paste code. Is there any way to clean that up by extracting the common code? Also, I'm not in a position to test at the moment, but I think at least the first sleep() (for the bootloader) is required for some boards. Were you able to test on some of the older Arduinos, e.g. a Diecimila? |
|
Yes, readPage/writePage and the binary implementations contain lots of duplicate code. I will rework that. Thanks for the note with 'Diecimila' I wasn't aware of that. Let me dig into the implementation of the reset via DTR. I will do some research if disabling the DTR signal is sufficient or not. |
|
Thanks, much appreciated! I've just moved and won't have my things for a few weeks, so unfortunately I'm not much help at the moment. :( |
|
It looks like the first wait may be required to keep compatibility with older boards.
Using a borrowed Diecimila clone of a friend I can perfectly reproduce the glitch. The first time the port is opened the board gets a reset. The second and following times not. So it looks like we need to keep the wait as described on |
Some further improvements
Result: Read Performance +30%, Write Performance (+80%)