- Recently I was in a DNS server project and that run on a ESP8266 board. I was notice that there's so much latency when I ping to a board run ESP8266 FreeRtos official code (about 50-100ms), but on another hand the board run Arduino core code is just a few ms(1-3ms).
- The both boards has almost identical app code and ESP8266 FreeRtos official code was optimized by myself(plain C and assembly) so let assume there's no difference between the both app code. Actually I was measured the app and optimized code faster a lot than Arduino app code(plain C and C++ overhead) so just assume that anyway.
- Both boards run on the same CPU frequency, same flash frequency.
The obvious answer would be to check the core src to see what they have done differently.
FreeRtos is an operating system which adds additional overhead to provide functional advantages. The Arduino base ESP8266 support runs on the bare hardware (so far).
- Wew, so the thing is I was so wrong about what arduino is. From my all experiences, every IDE I was touch are so bad and those SDKs from these IDEs are even worst, it's just a bad wrapper on the official SDK or Framework. So even in very big project like game, kernel or driver I've never use any IDE.
- Right now i'm trying to merge portable code to the Arduino, but very strange things are happening:
- There's no such thing called socket() unless: #define LWIP_COMPAT_SOCKETS 2
- There's nothing defined to use socket api: AF_INET, SOCK_DGRAM, IPPROTO_UDP
I'm so confuse about it, everything is included inside path tools/sdk/lwip2/include/lwip/. This project is did not just run on one platform, so it need a portable thing like socket API.
Espressif provides two SDKs for the esp8266, one RTOS based and one with no OS. The Arduino support is based on the no OS version.
For the esp32 the Arduino support is based on Espressi's FreeRtos SDK, so there is more function than on the Arduino esp8266 IDE. Or so I understand - I haven't done any esp32 projects yet.