Shop OBEX P1 Docs P2 Docs Learn Events
spin files... — Parallax Forums

spin files...

s2jesses2jesse Posts: 62
edited 2008-07-27 12:08 in Propeller 1
Ive been working on· larger projects now and including a lot of objects...

Its making me wonder how to organize the files... For instance. say im using the floatmath object·in one of my higher up spin files· Then in another spin file im using floatstring which also·uses floatmath.. So in the tree view there are separate instances of the same objects. Is this bad? if so anyway around it?

Also is it·bad performance / memory wise to separate a method into its own spin file vs just sticking it in an already used one?

thanks Jesse

Comments

  • hippyhippy Posts: 1,981
    edited 2008-07-27 12:08
    There's a slight overhead for creating a new object over inserting a method into an already used object or top level program; each object needs its own 'method table' which has to be added, one long per method in that object, and calls to a method in an object are slightly slower than a call to a method in the current object / top-level program.

    In general I would say the impact was minimal so design for what feels best, be that a separate object or not.

    The use of the same object in multiple sub-objects isn't really a problem. Only one copy of the object is included in the memory image even though there will be multiple entries for that object in the Explorer Tree.
Sign In or Register to comment.