OpenFL Haxe Performance Benchmark Project at GitHub

Modeled after Grant Skinner’s ActionScript project PerformanceTest, I’ve made a variation designed for OpenFL to benchmark segments of Haxe code.

Executing a batch of tests every 50-milliseconds on a Timer, each iteration runs a defined number of loops for multiple samples. Overhead baseline is removed from the result, and deviation of each iteration is denoted.

Download the source code at GitHub

Please feel free to recommend tests or pull request new tests over.

Here are some sample results:

Float math

Addition, subtraction, multiplication, and division on a floating point number.

FloatTestSuite.hx

float

float-platform

Object instantiation

Instantiating new instances.

InstantiationTestSuite.hx

instantiation

instantiation-platform

Casting

Casting instances to different types. Downcast tests casting a MovieClip to a DisplayObject. Upcast tests casting a DisplayObject to a MovieClip.

CastTestSuite.hx

casting

casting-platform

Event dispatching

Dispatching events with and without a listener added.

EventTestSuite.hx

event-dispatching

event-dispatching-platform

Function inlining

Function call overhead versus inlining functions.

FunctionInliningTestSuite.hx

function-inlining

function-inlining-platform

Loops

For, while, and do while loops both incrementing and decrementing.

Note that Haxe for loop range operate can’t iterate backwards; therefore, there is no decrement for loop test, as in:

for (i in 10000 ... 0) {}

loop

loop-platform

Graphics

Line drawing applied to a Shape instance.

Note that Flash drawPath appears in error; therefore, is not included in the test results below.

Note that HTML5 does not implement drawPath functionality.

graphics

graphics-platform

3 Likes