I need to compare how much certain libraries will occupy space on the Arduino when they are in use. We need this comparison in order to choose the physical components later on (in our case we're hesitating whether we should use LoRa or RF24 modules for communication - the smaller the library, the better).
I tried running an empty code just with #include<RF24.h> and #include<LoRa.h> in the begging, but it seems that when the library is not used, Arduino IDE (wisely) doesn't include it in the compiled code.
So does anybody know how can I check the respective sizes of these libraries?
Good luck! Some (many) libraries use dynamic memory and so change size all over the place depending on what's going on. When things get tight, don't waste your time doing infinite math. Just get a bigger processor.
You are seeing the effects of the compiler optimizing the code, only including what is actually needed for a particular sketch. The only way to get a comparison between the LoRa and RF24 libraries would be to write separate versions of the full sketch (or use compiler directives to allow you to switch between the two within the same sketch).
Alright, thanks for all the replies - I really appreciate your help
gfvalvo:
Are you concerned about the amount of program space or RAM space being used? What makes you think there will be a problem with either?
What is your target board?
We're aiming to build a system on the PCB around AtMega328p (the one that powers Arduino Uno as far as I remember). Our main concern is program space, as from previous projects it was the one that cluttered up much more quickly.