I'm (still) trying to solve an issue in my 2D Flash game where my framerate is dropping to unacceptable lows. I have a class with the following member variable and method:
protected var value:*;
public function getValue () :* {
return this.value;
}
Right now, that method is being called seemingly a few hundred times per frame and 2.23% of my application time is spent in that method.
Do you think that I'll notice a significance performance increase by making value
a typed variable? Making that variable typed will make code all over the application break so I'd like to be more sure that it will actually help.
Also, here's the top few records of the Performance Profile for my application, sorted by Self Time, which led me to suspect this getValue()
method in the first place:
Method Calls Self Time (ms)
------ ----- --------------
[pre-render] 0 2137 (19.68%)
[reap] 0 727 (6.7%)
[enterFrameEvent] 0 464 (4.27%)
[mouseEvent] 0 352 (3.24%)
[mark] 0 327 (3.01%)
State.getValue 792356 242 (2.23%)
[verify] 0 209 (1.93%)
[render] 0 159 (1.46%)
CollisionManager.detectCollisions 584 156 (1.44%)
Entity.updateAllStates 30227 154 (1.42%)
Entity.getStateValue 392412 143 (1.32%)
GSVector.set y 156244 141 (1.3%)
State.update 659738 123 (1.13%)