The performance of the tools used is a very important parameter for any developer. Especially nowadays, when it is measured in the smallest fractions of seconds.
Currently, there are about 700 different programming languages, each of which serves a specific purpose, satisfies a certain range of needs and has its own strengths and weaknesses. Of these, only 200-250 keep afloat. All these languages fall into 2 categories: either statically or dynamically typed.
The former are usually compiled: that is, the analysis and transformation of “human” code is done by the compiler, then a new file is created and then executed manually by the programmer. The dynamic ones, as a rule, are interpreted: that is, the interpreter analyzes and runs the code line by line.
Most programmers like dynamically typed languages because they are less prone to errors and much easier to interpret by humans (e.g., Python). But everything has a price, and in this case the victim is speed. We will now discuss examples of such relatively slow but nevertheless widespread languages, which belong to the dynamically typed group.
Perl
Perl scripting will be familiar to anyone familiar with UNIX. This language was created to simplify the tasks that developers had to perform when forming long “tablecloths” in Shell. We’re referring to the riddles of commands that were placed in 1 file and executed sequentially.
Also, Perl facilitated tasks considered a real nightmare to solve with C and other popular languages. But, as always, something had to be sacrificed, so Perl lagged noticeably behind in terms of performance.
In addition, a good Perl developer is incredibly difficult to find. Indeed, in contrast to the same Python, the language has a high sensitivity to the implementation: all operators in the code must be in the right place, otherwise effective program does not work.
Despite lagging behind high-level competitors, Perl is growing and evolving, and there are fewer and fewer problems with efficiency (a striking example is the release in 2019 of Perl 6).
PHP
A scripting language used in web development. It is usually used in tandem with HTML and CSS, as well as MySQL. Although you often hear that PHP is obsolete, w3techs research shows that it is used in about 80% of all web sites for the backend (less often for the frontend). StackOverflow last year also called PHP a competitive and desirable language, outperforming C++ and Typescript.
This language is good for almost everything: low threshold, simple syntax, and budget-friendly layout, but it lacks performance.
PHP’s slow speed is due to its lack of a JIT compiler, as well as its affiliation with dynamically typed languages.
In the second half of 2020, PHP 8 was released, which was equipped with not only a cool performance optimization, but also a built-in Just-in-Time compiler. These improvements helped it come very close to being in a class of its own for efficiency and speed.
Ruby
This language is easy to use due to its object-oriented nature. As for performance, it is slower than languages with a compiler because it is an interpreted language, i.e. it executes code sequentially: one statement after another.
The reason for Ruby’s slowness is GIL, long garbage collection times and high memory consumption.
Python
According to several reputable sources, such as statista and The Economist, the universal Python is in first place among all programming languages. It has found wide application in cybersecurity, data science, web development, etc.
The advantages of Python far outweigh its disadvantages, but most developers have complaints about the speed. Like Ruby, this language is slow because of interpretability and GIL.
Python, on the other hand, is full of powerful features and efficient libraries that greatly improve its performance. That’s why it continues to thrive, leaving other popular programming languages behind.
Bottom line
Speed and performance are very important factors for any developer. But we must not forget that often the problems associated with them are not due to programming languages, but to poor implementation and illiterate code design. So the most important thing is to study and get as much valuable experience as possible. And we wish you good luck in that!
Add comment