📜 ⬆️ ⬇️

Comparison of programming languages ​​for speed and not only

And you have it?


While doing different projects I use different languages ​​and sometimes it is much easier to form an idea in python if you don’t want to solve it in C ++. But any self-respecting developer who thinks at least a little bit in advance about the conditions in which his application will work, asks himself the question "is there enough python speed for me or is it better to write immediately with ++? Or maybe speed is not critical, but it’s important easy to write and maintain? " On Habré, periodically skip articles that highlight performance measurements in different areas of development, but there was no centralized information on languages ​​( unless the search deceives me ). Personally, in such cases I go to one very useful resource under the patronage of the Debian community and get informative graphs of statistics on a fairly large range of languages.

Read more


The project is called plainly: “ The Computer Language Benchmarks Game ” and under its roof are collected mostly the most popular programming languages. There you can take C ++ and compare it with Python or, for example, with Scala. Get statistics not only on how fast a particular language is, but also to see the memory consumption of the program on standard tests and even if the code size is larger / smaller.

For example C ++ vs Python 3:


From the graph you can clearly see that in some tests C ++ faster Python up to 100 times, and in some cases only 2-3 times (the tests themselves are of course provided as source codes). The memory consumption of C ++ is 3-6 times smaller, but the size of Python executable code at the output is up to 10 times smaller in places.
')
The creators of this project quite clearly understand that the performance of an application is not constant and depends on the specific program and task. Therefore, for tests, a dozen different programs and algorithms are used so that the statistics cover quite different situations: there are binary trees, recursions, and other joys of programmer life. One has only to say that there are a sufficient number of tests, and the graphs show only the main and most significant ones.

For particularly scrupulous people under the graphs are detailed tables with specific numbers.

In the appendage, you can study the effect on performance in assemblies for 32 and 64-bit processors (if of course compilers / interpreters work / generate code for the corresponding modes).

And of course the link to the project .

PS: It is possible that the leading figures from development know about this resource, but those who do not know can be a huge amount. For example, for many managers and project managers, such a resource is simply not known, but it may be urgently needed at the planning stage of the project and will allow them to make objective decisions with enough PHP or better to do the project right in java. And maybe at all in C ++.

Source: https://habr.com/ru/post/90942/


All Articles