StaticJsonBuffer
ArduinoJson uses preallocated memory to store the data and this is possible due to StaticJsonBuffer.
If one has to use this library then firstly they should create the StaticJsonBuffer just like:
StaticJsonBuffer<200> jsonBuffer;
then it creates an memory of 200 byte size which creates allocated memory in the system for storing the data static as the name tells it has fixed in size type of memory.Also we cannot reuse the memory once it gets allocated.it has high speed performance.
DynamicJsonBuffer
This library supports DynamicJsonBuffer since it has parameters for dynamic memory allocation
but it will be more useful if we use this buffer in the machine having memory more than 10KB of RAM.
to use this syntax is just similar.
DynamicJsonBuffer jsonBuffer;
This will create one dynamic memory for the system so that it can allocate it more precisely.its size is variable it stores the data in heap.while storing it take time and its somehow process slow
Comments