Arduino Forum

Using Arduino => Storage => Topic started by: JackBeanie on Mar 22, 2011, 09:53 am

Title: Estimating sketch size
Post by: JackBeanie on Mar 22, 2011, 09:53 am
Hi, is there any way to estimate the size of a program before writing it?
Title: Re: Estimating sketch size
Post by: PaulS on Mar 22, 2011, 12:10 pm
Quote
Hi, is there any way to estimate the size of a program before writing it?

Only in the vaguest possible terms, like small, humongous, and "won't fit".

Now, with some idea what hardware you are interfacing with, and the requirements for the application, then the estimate can be made a bit more accurate.
Title: Re: Estimating sketch size
Post by: WillR on Mar 23, 2011, 02:06 pm
If you are working with large arrays and so on -- yes -- to that extent.

Otherwise you have to do what I do -- I compile the code before I write it. That way I don't have to guess.
Title: Re: Estimating sketch size
Post by: robtillaart on Mar 23, 2011, 05:07 pm
Quote
Hi, is there any way to estimate the size of a program before writing it?

1) experience^2 is needed
2) if you use libraries with known size helps a lot
3) usage of floating point adds approx 3-4K to your code. (is also a lib)
4) the complexity of the algorithms needed
5) the amount of storage (including temporary) needed