Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do the terms "CPU bound" and "I/O bound" mean?

What do the terms "CPU bound" and "I/O bound" mean?

like image 882
Developer Avatar asked May 15 '09 13:05

Developer


People also ask

What do you mean by CPU-bound?

In computer science, a computer is CPU-bound (or compute-bound) when the time for it to complete a task is determined principally by the speed of the central processor: processor utilization is high, perhaps at 100% usage for many seconds or minutes.

How does I O bound CPU-bound and memory bound processes differ?

Answer and Explanation: The main difference among I/O bound, CPU bound, and Memory bound processes is the rate of completion of the process under respective devices. I/O bound processes will be the slowest, whereas the CPU Bound processes would be accomplished at the fastest rate.

Which is faster IO bound or CPU-bound?

Programs that are I/O bound are often slower than CPU-bound programs. Due to the use of the input-output system, the time spent waiting for data to be read or written can be substantial. This is considerably slower than the time it takes a processor to complete operations.

How do you tell if a process is CPU or IO bound?

Look at CPU usage and if its bordering at 100% it's CPU bound. If it's not there's an artificial bottleneck in the implementation. E.g. on a dual-core CPU a single threaded process will not go above 50% CPU usage.


2 Answers

It's pretty intuitive:

A program is CPU bound if it would go faster if the CPU were faster, i.e. it spends the majority of its time simply using the CPU (doing calculations). A program that computes new digits of π will typically be CPU-bound, it's just crunching numbers.

A program is I/O bound if it would go faster if the I/O subsystem was faster. Which exact I/O system is meant can vary; I typically associate it with disk, but of course networking or communication in general is common too. A program that looks through a huge file for some data might become I/O bound, since the bottleneck is then the reading of the data from disk (actually, this example is perhaps kind of old-fashioned these days with hundreds of MB/s coming in from SSDs).

like image 123
unwind Avatar answered Sep 22 '22 00:09

unwind


CPU Bound means the rate at which process progresses is limited by the speed of the CPU. A task that performs calculations on a small set of numbers, for example multiplying small matrices, is likely to be CPU bound.

I/O Bound means the rate at which a process progresses is limited by the speed of the I/O subsystem. A task that processes data from disk, for example, counting the number of lines in a file is likely to be I/O bound.

Memory bound means the rate at which a process progresses is limited by the amount memory available and the speed of that memory access. A task that processes large amounts of in memory data, for example multiplying large matrices, is likely to be Memory Bound.

Cache bound means the rate at which a process progress is limited by the amount and speed of the cache available. A task that simply processes more data than fits in the cache will be cache bound.

I/O Bound would be slower than Memory Bound would be slower than Cache Bound would be slower than CPU Bound.

The solution to being I/O bound isn't necessarily to get more Memory. In some situations, the access algorithm could be designed around the I/O, Memory or Cache limitations. See Cache Oblivious Algorithms.

like image 25
Sanjaya R Avatar answered Sep 20 '22 00:09

Sanjaya R