Jump to content
  • Advertisement
Sign in to follow this  
Nicholas Kong

Can someone give me examples of overhead and bottleneck?

This topic is 2134 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

To me, bottleneck seems to be a limitation of a system or environment that disallows a normal process from happening.


To me, overhead is a cost associated with the function or method of the program that has a lot of time complexity not sure if it uses space complexity too.


Not sure if my statements are correct. Examples from you all would clear a lot of things up.


But I managed to read the definitions from Wikipedia to get some ideas. But it still feels vague or uncertain to me because I am not sure how credible the below sources are.







Share this post

Link to post
Share on other sites
In a program, a bottleneck is when an identifiable feature (part of your program or something your program relies on) is limiting the speed of the rest of your process somehow. It's used very loosely.

- Any I/O which the rest of the program is waiting on.
- When the CPU is waiting for the GPU or vice-versa.
- When multiple processes/threads fight over a single resource (I/O, mutex, etc).
- When your program cannot keep up with a real-time process (if you cannot decode audio/video fast enough to play it in real time).

Overhead is either:
- When you're being needlessly wasteful, the 'waste' can be called 'overhead'.
- When you're required to do more work or store more data than you want to, the extra that you don't care about is the 'overhead'.

Overhead is purely subjective; A computer that's functioning normally does ONLY what it's programmed to do, so ostensibly there is never overhead from its point of view.

Generally, programmers should think about whether they are making required overhead worse by writing their code in certain ways.

- (required) Stack frame setup/teardown when calling functions.
- (wasteful) Using recursion when you don't need to.

- (required) Network packet headers.
- (wasteful) Sending one byte of payload data per packet instead of waiting a bit to send more data at once.

- (required) Locking a texture to access its pixel data.
- (wasteful) Locking and unlocking once per pixel instead of locking, writing a bunch of pixels, then unlocking.

- (required) Allocating a stack and ThreadContext when creating a thread.
- (wasteful) Creating and destroying threads for many short-lived tasks instead of reusing them (a Thread Pool). Edited by Nypyren

Share this post

Link to post
Share on other sites
A bottleneck is the part of your code or machine which most limits the performance of your code. You want to identify bottleneck in a program so that you focus optimizing them for performance, and don't waste time optimizing code that's not critical. Sometimes you can't do anything about the bottleneck, sometimes you can.

Commonly, a particular system resource is a bottle neck, such as network speed for communication application, RAM latency for Databases (or Drive speed for really big databases), the Drive for File mutating applications, or a particular CPU cache's speed for moderate size data crunching.

You can also think of a particular operation of a program as being a bottleneck if a lot more time is spend doing it than other operations, particularly if that part does not compete heavily with other part of the code. For instance, a chess program probably has AI as a bottleneck and graphics and sound are not performance critical.


Nypyren defined overhead pretty well. Anytime the program needs to do more than you want, that's overhead. Overhead can be unavoidable sometimes. Other times it might be insignificant and not worth bothering trying to remove it. Overhead is most often thought of in terms of time, because you optimize for performance, but memory overhead can be relevant too.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!