From 44e5549456bdff631e413bd3df2b3ae6f40fa506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Blanchon?= Date: Wed, 23 Jul 2014 13:29:56 +0200 Subject: [PATCH] Added code size --- JsonParser/README.md | 53 +++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/JsonParser/README.md b/JsonParser/README.md index 8a9bda04..0b652800 100644 --- a/JsonParser/README.md +++ b/JsonParser/README.md @@ -213,21 +213,38 @@ Here are the size of the main classes of the library. This table is for an 8-bit Arduino, types would be bigger on a 32-bit processor. - - - - - - - - - - - - - - - - - -
TypeSize in bytes
Parser<N>4 + 8 x N
JsonArray4
JsonObject4
\ No newline at end of file +| Type | Size in bytes | +| ------------ | ------------- | +| `Parser` | 4 + 8 x N | +| `JsonArray` | 4 | +| `JsonObject` | 4 | +| `JsonValue` | 4 | + +Code size +--------- + +The sizes have been obtained with Arduino IDE 1.0.5 for a Duemilanove. + +### Minimum setup + +| Function | Size | +| ------------------------------------ | ---- | +| `jsmn_parse()` | 962 | +| `JsonValue::operator[](char const*)` | 218 | +| `JsonParserBase::parse()` | 116 | +| `JsonValue::operator[](int)` | 108 | +| `strcmp()` | 18 | + +### Additional space for integers + +| Function | Size | +| ---------------------------- | ---- | +| `strtol()` | 606 | +| `JsonValue::operator long()` | 94 | + +### Additional space for floating points + +| Function | Size | +| -------------------------------- | ----- | +| `strtod()` | 1369 | +| `JsonValue::operator double()` | 82 |