ArduinoJson
ArduinoJson copied to clipboard
Feature request: excluding float support
Would it be interesting to add a configuration to disable support for floats to reduce the flash size? In my arduino code I avoid using them but when I check the listing file I see many json calls to float functions. Or could it be possible to let the compiler disable support because I never ask for a float while parsing the Json?
Hi @jputcu,
Would it be interesting to add a configuration to disable support for floats to reduce the flash size?
First, we must make sure that it's worth the effort. Can you try to remove some parts of the library to see how many bytes you can trim?
could it be possible to let the compiler disable support because I never ask for a float while parsing the Json?
In ArduinoJson 5, this was the case because the library stored all values as strings and parsed floats "lazily". However, in ArduinoJson 6, the library eagerly parses float values, so the compiler cannot eliminate the code. (This change significantly reduced string duplication and enabled the JSON to MsgPack use case.)
Best regards, Benoit
Sure, I will try to remove the floats in ArduinoJson and see how much that gives me. Could indeed be that it won't be much, we'll see.
I currently don't have the time to figure it out, so you could close the issue for now.