What is overhead?

15

I see this term a lot used when it comes to memory overuse, but I do not know in depth if it really is.

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

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

My questions are:

  • What does the term overhead mean in detail?
  • There is some relationship between overhead and objects?
  • How do you pronounce overhead ? :)
asked by anonymous 14.04.2017 / 17:17

2 answers

19

Overhead is overhead does not really matter the context of computing.

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

Just be aware 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 the creation of an abstraction causes some overhead , but the holy grail of computing is to achieve abstractions without overhead . The opposite is getting an overhead without a gain in some other way.

This overhead can be processing, memory consumption, general time, transmission, storage, source code size, final code, use, learning, architecture, it does not matter, it's overhead you need something more to get what you want, usually compared to something else that in theory does not have overhead , at least comparatively.

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

Overhead example is what is not payload , is what you pay extra cost to be able to transmit the data.

A TCP has an overhead compared to UDP, but it does have some advantages so it has higher cost.

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

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

A indirection is an overhead .

It can also be exemplified by using a VM.

Finally, thousands of examples can be cited.

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

The pronunciation is "ververréd". Listen .

    
14.04.2017 / 17:53
5

Additional Cost

This is the translation I prefer to use.

While it may be used in many 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 over and that something is over brings a machine cost, a cost of time, a cost of resource, etc.

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

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

In the case of OO , I understand that 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, structured programming. When doing this comparison we will check several points in the OO that seem to "go around" to reach the same goal and is called overhead . It's as if you added a cost of programming, time, compilation and execution to a program, which could be written in a simpler and more direct way without the need for the "extra cost" placed by OO . There are other aspects of a programming paradigm that can add costs, for example, project costs, technical documentation, tools, tests, etc. Although in comparison to the other paradigm seems to bring an extra cost, I understand that it is only the characteristic of that paradigm, that is, when adding these costs was meant to bring some facilities that the other paradigm did not have and therefore, that in that case, I understand to be a trade off and not an overhead .

A more prominent overhead example is in your SELECT * example. In this case you are adding to the query optimizer an additional cost that is to discover the names of the table columns and allocate space to bring up all the values of those fields. If you specified column names, 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 whether there is an alternative implementation of the function to serve as a comparison.

    
04.05.2017 / 15:31