I did this test on a friends' computer lateley and he wrote the same thing in c++. I don't remember the exact details of what we did but I think it was a for-to loop and using local integers. He turned on al optimization options for his compiler (don't know which) (of course he did, it'd be stupid to leave them off right?) and c++ turned out to be 10-20 millisecs faster than bmx. total time was about 2500ms.