-
Notifications
You must be signed in to change notification settings - Fork 60
How does this compare with ArduinoJson? #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @bblanchon, The goal of this library is to be simple to use, and avoid C/C++ concepts that Arduino users are not familiar with. |
Hi @sandeepmistry, Thank you for your answer but it doesn't provide any comparison with ArduinoJson, nor any guidance to choose one or the other. I made my own comparison and benchmark; you can read the article on arduinojson.org FeaturesJSON support
Compatible types
Integration with the C++ language
Other features
Project information
PerformanceSerialize to
|
ArduinoJson | Arduino_JSON | |
---|---|---|
Program size | 3.6 KB ✔️ | 7.9 KB |
Running time | 2.2 ms ✔️ | 2.3 ms |
Heap allocations | 0 ✔️ | 20 |
RAM usage | 426 B ✔️ | 454 B |
Fragmentation | 0 % ✔️ | 1.5 % |
Serialize to String
ArduinoJson | Arduino_JSON | |
---|---|---|
Program size | 5.2 KB ✔️ | 8.0 KB |
Running time | 2.1 ms | 1.9 ms ✔️ |
Heap allocations | 2 ✔️ | 21 |
RAM usage | 499 B ✔️ | 534 B |
Fragmentation | 0 % ✔️ | 6.21 % |
Serialize to char[]
ArduinoJson | Arduino_JSON | |
---|---|---|
Program size | 3.8 KB ✔️ | 8.2 KB |
Running time | 1.7 ms ✔️ | 1.9 ms |
Heap allocations | 0 ✔️ | 21 |
RAM usage | 492 B ✔️ | 522 B |
Fragmentation | 0 % | 0 % |
Deserialize from const char*
ArduinoJson | Arduino_JSON | |
---|---|---|
Program size | 4.0 KB ✔️ | 11 KB |
Running time | 0.8 ms ✔️ | 0.9 ms |
Heap allocations | 0 ✔️ | 10 |
RAM usage | 449 B ✔️ | 540 B |
Fragmentation | 0 % | 0% |
Deserialize from char[]
ArduinoJson | Arduino_JSON | |
---|---|---|
Program size | 4.1 KB ✔️ | 11 KB |
Running time | 0.8 ms ✔️ | 0.9 ms |
Heap allocations | 0 ✔️ | 10 |
RAM usage | 488 B ✔️ | 540 B |
Fragmentation | 0 % | 0% |
Using a char[]
enables the zero-copy mode of ArduinoJson, saving a large amount of memory.
Deserialize from Serial
ArduinoJson | Arduino_JSON | |
---|---|---|
Program size | 4.2 KB ✔️ | 11.3 KB |
Running time | 2.9 ms ✔️ | 1004 ms |
Heap allocations | 0 ✔️ | 73 |
RAM usage | 387 B ✔️ | 468 B |
Fragmentation | 0 % ✔️ | 3.82 % |
Conclusion
- ArduinoJson has many more features than Arduino_JSON.
- ArduinoJson is almost twice smaller than Arduino_JSON.
- ArduinoJson is slightly faster than Arduino_JSON.
- ArduinoJson consumes less RAM than Arduino_JSON (provided that the memory pool is adjusted).
- ArduinoJson doesn't increase memory fragmentation.
- Arduino_JSON is slightly easier to use
Best Regards,
Benoit
Hi!
I'm the developer of ArduinoJson.
I'm curious to know how this library differs from it.
Why should someone choose this one over ArduinoJson?
Best Regards,
Benoit
The text was updated successfully, but these errors were encountered: