Marauroa 3.8: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Hendrik Brummermann |
imported>Hendrik Brummermann |
||
| Line 55: | Line 55: | ||
; Reason for change : Improve performance in games with deep RPClass inheritance hierarchies, many objects, and lots of redundant put() and get() calls |
; Reason for change : Improve performance in games with deep RPClass inheritance hierarchies, many objects, and lots of redundant put() and get() calls |
||
; Impact on Marauroa users : New methods in RPClass: bake() and bakeAll(). You don't have to use them but if you do, it will make a snapshot of the inheritance hierarchy to optimize performances. Further changes in super classes will not be propagated to children. |
; Impact on Marauroa users : New methods in RPClass: bake() and bakeAll(). You don't have to use them but if you do, it will make a snapshot of the inheritance hierarchy to optimize performances. Further changes in super classes will not be propagated to children. |
||
; Details : I was wondering why Marauroa is so much faster on Marboard with 100,000 objects and a turn time of 30ms than it is in Stendhal with less objects and a turn time of 300ms. Using a profiler it turned out that a deeply nested inheritance hierarchy slows down calls to RPObject.get() and RPObject.put() |
; Details : I was wondering why Marauroa is so much faster on Marboard with 100,000 objects and a turn time of 30ms than it is in Stendhal with less objects and a turn time of 300ms. Using a profiler it turned out that a deeply nested inheritance hierarchy slows down calls to RPObject.get() and RPObject.put(). Those calls need to find the attribute definition (get() because of static attributes and put() in order to validate the datatype). And Stendhal does a huge amount of get()s and put()s every turn. |
||
: Baking a class is similar to baking a cake: After you have thrown in all the ingredients, the cake is baked which causes the ingredients to melt together. In Marauroa: After all the attributes are defined in the inheritance hierarchy, baking means that the attribute of parent classes are melted into the child classes. Just like you cannot take the eggs out of a baked cake, further changes to attributes |
: Baking a class is similar to baking a cake: After you have thrown in all the ingredients, the cake is baked which causes the ingredients to melt together. In Marauroa: After all the attributes are defined in the inheritance hierarchy, baking means that the attribute of parent classes are melted into the child classes. Just like you cannot take the eggs out of a baked cake, further changes to attributes are not visible in child classes. |
||