|
Lambdamoo efficiency question wrt constants
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Inge Jones
(3 posts) bio
|
| Date |
Fri 25 Sep 2009 07:03 AM (UTC) [ quote
] |
| Message |
I am planning a game where there will be many non-customisable child instances of each class of object or player, each one bearing many long strings. Constants, in practice.
The natural thing to do is use Lambdamoo's inbuilt inheritance system, but I am worried that will waste loads of memory as each player and object will carry its own full copy of these strings, which are not intended to be individually updatable anyway, whilst I would wish them to all be updated any time I changed the settings in the parent.
I was therefore thinking of setting up a constants repository object which is not a parent of any of these objects, and referring sideways to it as needed.
Can anyone tell me whether I am right in my assumption that child objects keep a complete copy of their inherited property values, with all the memory implications that has? Also does anyone know whether by using a seperate constants repository item, rather than objects being completely self-referencing, there will be a significant slowing in response times (ie increase in processing demands)? | top |
|
| Posted by |
Coderunner
USA (27 posts) bio
|
| Date |
Reply #1 on Fri 25 Sep 2009 08:41 AM (UTC) [ quote
] |
| Message |
Hello,
I'm pretty sure that unless a property that has been inherited by a child object has been changed on said child object, that the MOO simply checks the value of the property on the parent object.
HTH,
Jason. | top |
|
| Posted by |
Inge Jones
(3 posts) bio
|
| Date |
Reply #2 on Fri 25 Sep 2009 08:45 AM (UTC) [ quote
] |
| Message |
| Thanks very much, Jason, that will certainly make life easier :) | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
1,084 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )