mlesniew / PicoMQTT

ESP MQTT client and broker library
GNU Lesser General Public License v3.0
219 stars 25 forks source link

Benchmark correctness #31

Closed samipfjo closed 3 months ago

samipfjo commented 3 months ago

It is entirely possible that I'm reading the graphs wrong, but I am a little baffled why the ESP32 would perform so much worse than the ESP8266 given the former's faster processor. One would expect it to at minimum have the same performance. Is there some intrinsic bottleneck?

mlesniew commented 3 months ago

The library is much slower on the ESP32.

From what I read online, this is not unusual. People have reported that the ESP32 is slow on the network compared to the ESP8266.

It seems to be related to the fact that the ESP32 runs RTOS which adds overhead. Additionally the network stack aims to be more complete and follow specifications more strictly.

On the ESP8266 there's a lightweight IP stack which trades speed and simplicity for safety and correctness.

Anyway, I haven't analysed it too much, because even with the reduced performance the library is sufficiently fast for most use cases.

samipfjo commented 3 months ago

Ah, that makes sense. That's something I'd yet to come across. Thanks for taking the time to explain; I appreciate it.