Basic Comparison of High-Level Programming Languages
Fourteen simple test cases were used to compare Python, Julia, Java, Scala, IDL, R, and Matlab, with Fortran and C included as a baseline. The test cases were implemented from the angle of a novice programmer who is not familiar with the optimization techniques available in the languages. The tests aimed to highlight the strengths and weaknesses of each language rather than to claim one language’s superiority to the others. Measurements recorded the elapsed time to complete the same test case operation with each of the different languages. The performance was investigated in four main categories: loops and vectorization, string manipulations, numerical calculations, and input/output. Specific measurements tested the speed of memory access, recursion, file processing, matrix calculations, iterative solvers, and other common applications in scientific computing. No single language outperformed the others in all of the tests. Expected trends were demonstrated, such as which languages offer faster performance when using iteration versus vectorization, and that intrinsic functions operate more quickly than equivalent inline code. The performance of numerical calculations in each language was found to significantly depend on the specific task. Performance of I/O operations was found to depend more strongly on hardware resources than the language used. The results can serve as a reference for programmers who wish to determine which language(s) may be suitable for specific applications.