Current ongoing work..

72 views
Skip to first unread message

Ben Cooley

unread,
Aug 21, 2013, 9:20:38 PM8/21/13
to plays...@googlegroups.com
The PlayScript team is currently working on the following..

Android Support

The initial check in for Android support was yesterday.  PlayScript starling is running some basic tests, but we're still working on filesystem support for Android.

Acceptance Tests

Work on getting the acceptance tests to compile and run for ActionScript is ongoing.   The tests are currently blocked by lack of support for the COMMA operator, and support for multiple packages in one file (a PlayScript feature).

Dynamic Runtime Optimization

Work continues on optimization of teh AOT dynamic runtime.  We will be replacing the Expando object with a more heavily optimized for mobile dynamic dictionary object.  

Vector Optimization

A lot of profiling work has been done on the basic low level collection types, comparing them both to C++ and to Adobe AIR.  The good news is that with a fair bit of tweaking, and with Mono ABC removal we get essentially identical performance with C++ std::vector.   The bad news is that this requires some code changes as - in order to get this performance - we have to jetison some of the not commonly used semantics of Vector.<>.

The performance issue for Vector.<> (and for Array) turns out to be that when getting an indexed value that is out of range it returns a default value, and when setting a value out of range it expands.   This simple check breaks the LLVM optimization for array access, and adds additional overhead for element access.  

To address this, we've added a new PERFORMANCE_MODE compile define which disables these semantics for Vector.<>.  In DEBUG mode, trying to access an index outside of array bounds generates an InvalidOperationException().  And in RELEASE mode it simply generates an IndexOutOfRange exception.   If array bounds checking is turned off, it silently succeeds (as C++ does).

In games that we've tested,  enabling PERFORMANCE_MODE was simply fixing the bugs revealed by the exceptions, then running the game with ABC removed.  Since the normal bounds checking has left the game with code which does not go beyond array bounds, this works fine, and the resulting increase in performance saves a few milliseconds per frame (depending on the usage of Vector.<> in the game).  

Microbenchmarks

We now have a growing set of VM benchmarks that we are using to compare C++, Adobe AIR, and PlayScript performance.  The goal is to optimize common performance critical VM code to the point where it is as close to the optimal C/C++ implementation as is possible while still abiding by the semantics of the language.  Where the semantics can be changed in a minor way to permit additional performance gains, we will add PERFORMANCE_MODE checks in DEBUG mode to allow games to change their code to take advantage of the faster performing semantics.


Reply all
Reply to author
Forward
0 new messages