What is overhead?

I see this term used a lot when it comes to overuse of memory, but I don't know in depth if it is really that.

I noticed that here on the site this term was used in some questions:

My other doubt is that I always see this term overhead being quoted when talking about OOP (specifically talking about discussions about its use in the PHP language).

My doubts are:

  • What does the term overhead mean in detail?
  • is there any relationship between overhead and objects?
  • how to pronounce overhead? :)
Author: Pagotti, 2017-04-14

2 answers

Overhead is overhead it doesn't matter much the context of computing.

We could translate as overhead. The literal translation would be "above the head". It would indicate that it is above the normal size of the person.

Just note that in our context the term is simplified and in fact it is the overhead cost. So the translation is " paying an extra price for something."

It is very common that creating an abstraction causes some overhead , but the holy grail of computing is to achieve abstractions without overhead. The opposite is to get a overhead without a gain in some other aspect.

This additional cost can be processing, memory consumption, time in general, transmission, storage, source code size, final code, usage, learning, architecture, it does not matter, it is overhead if you need something more to achieve what you want, in general compared to something else that in thesis does not have overhead , at least comparatively.

Do not understand it as something inherently bad. It can have a compensating gain. Not every overhead can be eliminated, even if you give up something unimportant.

In example of overhead is what is not the payload, it is what you pay extra cost to be able to transmit the data.

A TCP has a overhead relative to the UDP, but it has some advantages so it has higher cost.

A very complicated code has a overhead to understand. There is the overhead that an object needs for the memory booking .

A function needs to prepare and finish executing the code it has to execute.

A indirection is a overhead .

Can also be exemplified with the use of a VM.

Anyway, it gives to cite thousands of examples.

OOP can have several overheads and in addition to the more technical ones, already demonstrated in question linked, there is the learning one since it is not simple to learn to do right and not abuse and the code becomes larger.

The pronunciation is "ôverréd". listen .

 29
Author: Maniero, 2020-05-13 12:19:28

Additional Cost

This is the translation I prefer to use.

Although it can be used in various contexts, I understand that the term "additional cost" seems to give a good understanding in most cases because the term is always used with an intention to say that something is extra and that something extra brings a machine cost, a time cost, a resource cost, etc..

An analogy I find interesting, and analogies need to be used sparingly, it would be to compare the overhead to a cake topping. In some situations a topping is essential to characterize the cake and in other cases it only leaves the cake heavier, but with the same taste.

What I mean by this is that it is a term that may not refer to something bad. For each case it is necessary to understand if the overhead is something connected to a trade off , that is, something Additional that has a benefit, it is just something Additional that can be controlled or is just a feature of technology. To answer your question of a overhead in detail you need to add a context because for each one you can have a different detailed explanation.

In the case of OO , I understand that the overhead is a trade off. I use this argument because it is likely that in this case a comparison is being made to another paradigm, for example, that of structured programming. By doing this comparison let's check several points in OO that seem to "go around" to achieve the same goal and it is called overhead. It is as if you added a programming, time, build and execution cost to a program, which could be written in a simpler and more straightforward way without the need for the "additional cost" placed by OO. There are other aspects of a programming paradigm that can add costs, e.g. design, technical documentation, tools, testing, etc. Although compared to the other paradigm seems to bring an extra cost, I understand that it is only the characteristic of that paradigm, that is, by adding these costs had the objective of bringing some facilities that the other paradigm did not have and so, that in this case, I understand to be a trade off and not a overhead.

A clearer example of overhead is in your example of SELECT *. In in case you are adding to the query optimizer an additional cost that is to find out the names of the table columns and allocate space to bring all the values of these fields. If you specified the names of the columns, you would avoid this additional cost.

In case the question of the performance of a function is related to its size, as you can see in that question, it is quite relative. In this case I would not use the term overhead because the context is dynamic and depends on there is an alternative implementation of the function to serve as a comparative.

 6
Author: Pagotti, 2017-05-04 13:31:02