Newbie Spin question re OBJ overhead
cweger
Posts: 4
Hi,
I received my Propeller last week, so I'm pretty new to this stuff; apologies if this is a dumb question.
Does each "OBJ" declaration in Spin programs have much impact in the generated runtime? Is there an advantage to bundling objects together (i.e. is there significant per-object overhead at runtime)?
If I wanted to use, say, 20 smaller single-purpose objects rather than 3 or 4 more comprehensive ones, would that cause runtime code bloat? Or would that only result in editor/compiler overhead, without any runtime consequences?
Just trying to decide how to segment things for development & code management purposes.
Thanks!
-Chuck
I received my Propeller last week, so I'm pretty new to this stuff; apologies if this is a dumb question.
Does each "OBJ" declaration in Spin programs have much impact in the generated runtime? Is there an advantage to bundling objects together (i.e. is there significant per-object overhead at runtime)?
If I wanted to use, say, 20 smaller single-purpose objects rather than 3 or 4 more comprehensive ones, would that cause runtime code bloat? Or would that only result in editor/compiler overhead, without any runtime consequences?
Just trying to decide how to segment things for development & code management purposes.
Thanks!
-Chuck
Comments
If you had 20 small single-purpose objects, each with a buffer of some sort (maybe 32 bytes), you'd need 20 * 32 bytes for variable storage. If you had only 3 or 4 more comprehensive objects, each with a 32 byte buffer that was shared by all the routines, you'd need 4 * 32 bytes for variable storage. Depending on the actual circumstances, there could be other solutions as well.
-Chuck