This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Algorithm is exponential - very bad. It is just meant to exercise the CPU a bit and | |
to see what happens with different languages. Not representative of real code. | |
Interesting that Java beats C, thanks to HotSpot. I expected Swift to be as fast as C | |
at least. I also expected the compiled Swift to be faster than when run as a script. | |
A bit disappointed, but more time needed to see where the bottlenecks are. Plus I | |
need to run some real code for benchmarking. | |
Update: swiftc -O improved the speed quite a bit to be about the same speed as Java | |