I/O Interfaces & Buses
Which is most effective for speeding up a program that exchanges thousands of small pieces of data with a device one at a time?
- AOnly switch to a link generation with twice the bandwidth
- BBatch the data into large chunks to reduce the number of exchanges
- CSplit each piece into even smaller parts
Show answer and explanation
Answer: B. Batch the data into large chunks to reduce the number of exchanges
Each small exchange incurs latency and software overhead while leaving the bandwidth mostly idle. Sending the data together in one go pays latency fewer times and uses the bandwidth effectively. Storage and networking use the same idea widely, for example by queuing several requests and submitting them at once, or by coalescing interrupts.
- A. With small data latency dominates, so the gain is small.
- B. Correct. Latency is paid fewer times.
- C. More exchanges make it even slower.