What is an overhead?

Asked

Viewed 9,761 times

23

I see that term used a lot when it comes to the excessive use of memory, but I don’t know in depth if that’s really it.

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

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

My doubts are:

  • Which means, in detail, the term overhead?
  • Is there any relationship between overhead and programming geared to objects?
  • How do you pronounce overhead? :)
  • Before anyone asks about "find it easy on Google", read the discussion in Meta: It is wrong to ask for things that are easily found (as some judge) on Google?

  • 2

    Fine line....

  • 3

    I also think it’s not wrong, but if the sources of searches in Google are reliable, sorry, but it seems to me like rain in the wet.

  • @Leocaracciolo I will not argue about it. Several questions that I and others have asked here on the site, which are "found in Google", were well accepted here.

  • 4

    @Leocaracciolo Google only points to the sites that have the answers, so why not point to Sopt? Finding things on Google may be easy, but finding quality content is another story! ;)

2 answers

30


Overhead is overhead does not matter much 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 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 "pay 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 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, never mind, it’s overhead if you need something more to get what you want, in general compared to something else that in theory does not have overhead, at least comparatively.

Don’t take it as something inherently bad. It can have a rewarding gain. Not all overhead can be eliminated, even if you give up something of little importance.

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

A TCP has a overhead compared to 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 to the booking from memory.

One function needs to prepare and finalize the execution of the code that she has to perform.

One indirect is a overhead.

Can also be exemplified with the use of a VM.

Finally, we can cite thousands of examples.

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

The pronunciation is "verréd". Listening.

  • 4

    It’s like a cap, It helps protect your head from the sun’s rays, but it’s not for free. Even if someone gave it to you, it cost that person. One way or another, it has a cost, it’s called overhead. The hat is literally "over head". ;)

6

Additional Cost

This is the translation I prefer to use.

Although it can 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 more and that something more brings a machine cost, a time cost, a resource cost, etc..

An analogy that I find interesting, and analogies need to be used sparingly, would be to compare the overhead to a cake icing. In some situations a topping is essential to characterize the cake and in other cases it just makes 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, is just something additional that can be controlled or is just a feature of the technology. To answer your question of a overhead 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 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. When making this comparison we will check several points in the OO who seem to "turn around" to achieve the same goal and is called overhead. It is 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 "additional cost" placed by OO. There are other aspects of a programming paradigm that can add costs, for example, project costs, technical documentation, tools, testing, etc. Although compared to the other paradigm it seems to bring an extra cost, I understand that it is only the characteristic of that paradigm, that is, to add these costs had the objective to bring some facilities that the other paradigm did not have and therefore, that in this case, I understand to be a trade off and not a overhead.

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

If the question of the performance of a function is related to its size, as you can see in that question, it’s quite relative. Then I wouldn’t use the term overhead because the context is dynamic and depends on there being an alternative implementation of the function to serve as comparative.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.