Results
Part 1 - For loop from 0 - 999999
real : 0.01000 vs 0.89133 = 89.1330000
user : 0.00600 vs 0.60667 = 101.111667
syst : 0.00233 vs 0.02667 = 11.4463519Part 2 - For loop outputting 0 - 99999 to stdout
real : 4.46367 vs 4.77933 = 1.07071759
user : 0.04866 vs 0.29000 = 5.95972051
syss : 0.08366 vs 0.25233 = 3.01613674Part 3 - For loop outputting 0 - 999999 to file
real : 0.49400 vs 5.28133 = 10.6909514
user : 0.43700 vs 2.84867 = 6.51869565
syss : 0.03067 vs 2.37233 = 77.3501793Part 4 - For loop executing a shell command 999 times
real : 7.01067 vs 9.60100 = 1.36948394
user : 2.89033 vs 3.10000 = 1.07254189
syss : 3.33100 vs 5.75767 = 1.72851096Conclusion
C++ outdid php in every single test. The least performance gain c++ took over php was in outputting the loop results into stdout (when its printing out stuff) with a factor of ~1.07 and c++ outdid php the most in just running through a loop (doing sorting, internal calculations) by c++ doing it almost 90 times faster than php.
Update: It seems I have misplaced the source files between site migrations, sorry about that.
