TweenGMS – YYC Performance Boost

With TweenGMS, I have made use of script_execute() functions instead of switch statements to enhance performance. However, I have since found that this optimisation, while improving the standard VM and JS exports, greatly limits the YYC (C++ compiler). So, I experimented with changing out script_execute() for switch statements when executing property setters and easing algorithms. The performance gains for YYC were much higher than I originally expected. Below are benchmark results from my test.

The benchmark used patrolling tweens with the EaseInOutSine algorithm. The numbers below represent the number of tweens running before frame rate drops below 30. Run on a AMD 2.2GHZ quad core cpu (only one core used).

3500VM Runner using switch statement

5220VM Runner using script_execute() -> 49% gain over previous

12720YYC using script_execute() -> 144% gain over previous

28240YYC using switch statement -> 122% gain over previous

As you can see, there is a huge difference between these numbers. It is easy to see why I originally used script_execute, as it greatly improves performance for the standard VM Runner by nearly 50%. When using script_execute, there are still massive gains over the VM Runner when using the YYC. However, when reverting back to switch statements for the YYC, gains are through the roof. YYC performance more than doubles and pushes 5X faster than the optimised VM Runner version(8X faster than VM-switch).

In a future TweenGMS update, I will be adding an optional optimisation path which will allow you to get these gains when using the YYC. By default, the system will continue to use script_execute, but with a tiny bit of extra work, you can easily switch on (or off) the YYC optimisations provided by managed switch statements for easing algorithms and property setters.

 

Leave a Reply