Go Down

Topic: Ethernet2 (UDP) SPI transfers have a lot of dead time (Read 9481 times) previous topic - next topic

pjrc

For one final test, I put the Arduino.org Ethernet2 shield on Arduino Due.  Wiznet's library does work with this shield.  I don't know why it fails on the Seeed W5500 shield.  Both work on Due with Ethernet 2.0.0.

Arduino Due with the W5500-based Arduino.org Ethernet2 speed is 394.80 kbytes/sec.  Ethernet 2.0.0 gets 695.35 kbytes/sec with that shield on Due.

weird_dave

Thanks for sharing those results. Is there a result for the wiznet library on the 5500/Due?

pjrc

Thanks for sharing those results. Is there a result for the wiznet library on the 5500/Due?
Yes.

"Arduino Due with the W5500-based Arduino.org Ethernet2 speed is 394.80 kbytes/sec.  Ethernet 2.0.0 gets 695.35 kbytes/sec with that shield on Due."


pjrc

With all these optimizations in Ethernet 2.0.0 (removing the *many* prior bottlenecks in the Ethernet library), I believe these benchmarks would at least doubled on Arduino Due if someone were to optimize the SPI.transfer(buffer, length) well.  Much of the hard work for those SPI optimizations has been done in the messages on this thread.  But hardly anyone will ever benefit until someone goes to the trouble of actually updating Due's SPI library.

weird_dave

OK, I took the Arduino.org Ethernet2 library not to mean the Wiznet library since they are different (or were last time I checked).
When I get some spare time, I'll give it a go, thanks for the effort :)

westfw

Quote
I recently released Ethernet library version 2.0.0
Wait - you got all that improvement WITHOUT implementing write-only SPI functions?
Wow.
(Hmm.   Not that I'm sure that a write-only SPI would be much faster.  Mostly just ... easier?  No more overwriting your output buffer (?))

pjrc

Yup, the old Ethernet lib was horribly inefficient on every level.

Due's SPI library is still very inefficient, which holds back Due's performance to ~700 kbytes/sec.  If someone were to improve the SPI lib, I believe Due could probably even outperform Teensy (where the SPI lib is highly optimized) on these tests, because Due is the only board that can actually produce a 14 MHz SPI clock.  Pretty much all the others use 8 or 12 MHz when SPISettings asks for 14 MHz max.

The SPI lib on Due isn't my project.  My dev cycles are funded by Teensy sales.  All this optimization work came from Teensy's fork of Ethernet.  Occasionally I try to contribute Teensy's improvements back to the rest of the Arduino community, so everyone can benefit.  Hope everyone gets some good use from it.  :)

Go Up