Purely out of personal interest, as you'd provided code for a benchmark, I thought I'd port it to Haxe/OpenFL and see how it compared there.
For reference, this is how it benchmarked with AIR 32:
Intel i7-7700K (Q1,2017)
32: 13278
64: 41731
Haxe/OpenFL:
C++ (Windows): 829
HTML5 Chrome: 2062
HTML5 Firefox: 8606
HTML5 Edge: 13390
Neko: 100376
C++ performance was awesome. Neko performance was surprising as that's generally regarded as being near C++ performance. I would have liked to test AIR/Flash, but I'm having issues compiling to those targets at the moment, there may be a bug in the current OpenFL/Lime release.
Here's the Haxe code for reference:
package;
import openfl.Lib;
import openfl.display.Sprite;
import openfl.events.Event;
import openfl.text.TextField;
import openfl.text.TextFormat;
class Main extends Sprite
{
private static var i:Int = 0;
private static var c:Int = 0;
private static var m:Int = 0;
private static var f:Int = 0;
private var _logTextField:TextField;
public function new()
{
super();
if (stage == null) addEventListener(Event.ADDED_TO_STAGE, init) else init();
}
private function init(e:Event = null):Void
{
_logTextField = new TextField();
_logTextField.text = "Benchmarking...";
_logTextField.defaultTextFormat = new TextFormat('Consolas', 30, 0xFFFFFF);
addChild(_logTextField);
Lib.setTimeout(runTest, 1000);
}
private function runTest():Void
{
var time:Int = Lib.getTimer();
for (i in 0...500000000)
{
f += incrementC();
f += incrementM();
}
_logTextField.text = Std.string(Lib.getTimer() - time);
trace(Std.string(Lib.getTimer() - time));
}
private function incrementM():Int
{
if (isModule2(c) == 1)
{
c += 1;
}
else
{
c += 2;
}
return c;
}
private function incrementC():Int
{
if (isModule2(m) == 1)
{
m += 1;
}
else
{
m += 2;
}
return m;
}
private function isModule2(v:Int):Int
{
if (v % 2 == 0)
{
return 1;
}
else
{
return 0;
}
}
}