Question

When talking about execution time between high- and low-level programming languages I often hear that low-level languages performs a bit better than high-level.

Of course a low level can perform worse than a high-level depending on the programmer and algorithms. But if we use the very minimal code needed to do different tasks. Will there most often be differences in execution time due to the abstraction level of different languages?

And also, does anyone know any good books about these kind of topic?

Was it helpful?

Solution

First off, low-level vs. high-level is not a well-defined language attribute. It tends to be used to refer to the accessibility of primitive machine capabilites, to the abstraction facilities the language provides, and again to describe the specific abstraction level of available libraries. And while these aspects are arguably correlated, they are not dependably so -- none of them is required for another.

Lack of access to machine primitives naturally removes flexibility for general-purpose performance programming, but languages without such access can achieve high performance for particular domains by using libraries and/or runtimes that are specialized for that domain (e.g., NumPy and Matlab performance with linear algebra).

Poor abstraction facilities make design, development, use, reuse, and maintenance harder. This doesn't necessarily impact potential performance directly -- but practically speaking, efforts put into mechanics aren't being used to improve performance. Likewise, lack of high-level libraries doesn't necessarily impact performance directly, but poorly-built re-implementations of essential facilities can have the same effect.


So, to answer your question: in no aspect does language "level" generally determine performance. But, there is always a "but"...

Additionally, there are costs to "wide-spectrum" languages such as C++, which combine access to primitive capabilities with good abstraction facilities and extensive libraries: complexity and cognitive load, which (IMHO) are the drivers of the aforementioned correlation between the different aspects of language "level".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top