from what I have learned so far, the main performance hog in AS extensions is the fact that for each instance they have to be re-compiled in byte-code. Therefore for any game room created at runtime the extension needs to recompiled from scratch, stressing the server.
I have a question to know if an architectural choice I implemented can prevent, or at least partially prevent this.
The game room extension is only very very basic. All the logic, deck of card, game situation, game logic, etc. are instances of classes created with the middle-age styled prototype chain, that somehow works quite well.
Now here is the trick:
The classes are instantiated by zone level extensions, that live only for the purpose of providing instances, and getting them back for GC/recycling.
Therefore, the whole class is stored and instantiated in an extension that gets compiled only once.
The room extension itself will only retrieve the correct instances with something similar to:
Code: Select all
var _deck = UDeckExt.getInstance();Code: Select all
UDeckExt.storeInstance(_deck);
_deck = null;Does this make sense?
Also, are there other by-passable performance issues with AS extensions?
thanks
Filippo