Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
iCarnegie.doc
Скачиваний:
10
Добавлен:
25.02.2016
Размер:
577.54 Кб
Скачать

2.5.2 Bottlenecks

  • Bottlenecks—Slowing a Process

  • Typical Bottlenecks

  • Eliminating Bottlenecks

Bottlenecks—Slowing a Process

Wide-mouthed glasses empty their contents more rapidly than bottles with long thin necks. To do any task, many steps are involved. A bottleneck is a step that takes a long time to complete, and thus reduces overall performance. Just as in the adage "A chain is only as strong as its weakest link," it is true that a process's speed, or throughput, is limited by its slowest step.

One implication of this is that it does not pay to get a tremendously fast processor, if the memory is slow in letting information flow in and out. In just the same way, a slow disk will impede overall system performance. If other parts of your computer are too slow, buying a faster processor may not speed things up at all!

For example, suppose you are executing a program. It is taking forever. What is the right thing to do to fix this problem? Since the system is an old Pentium II machine, not Ethernet Pentium 4, you are tempted to replace it on the spot. But there are other explanations. You might be running low on RAM, or your bus is not transferring data fast enough.

Similarly, the time required to perform a task that consists of several steps may be dominated by the step that takes the longest time. If this is the case, speeding up the other steps may have little effect. Suppose that making your favorite dinner involves 10 minutes of chopping ingredients, 2 hours of roasting, and 15 minutes of stirring gravy. If buying a food processor allows you to do all the chopping in just one minute, a factor-of-ten speedup, your overall time in the kitchen will be cut by only 6%. On the other hand, if you were to buy a convection oven that cuts your roasting time in half, the 100% increase in speed will save an hour and cut your overall time by 41%.

Typical Bottlenecks

The following are some areas of the hardware system that may contain a bottleneck:

  • Cache

  • RAM

  • I/O

  • Video card (particularly for 3-D gaming)

The cache slows the system down when there is not enough cache. Faster processors requiring more data input to run optimally may not receive enough data from small caches.

RAM loads instructions from programs on disk. Therefore if there is not enough RAM memory, instructions will need to be loaded frequently from disk slowing down the execution of program instructions.

I/O covers information transfer. Are the buses fast enough? Is the hard drive fast enough? The components may be able to send the data quickly enough, but if the system cannot transfer the data just as quickly, the system slows down.

Most business users will not suffer from a slow video card. Gamers, graphics designers, and some engineers need high-speed video cards in order to keep pace with the requirements of the software. The average user does not need one of these video cards; however, the slow 3-D rendering frame-rates produced by slower cards may hamper the performance of some applications.

Eliminating Bottlenecks

Can we speed up a computer? Actually it isn't usually the computer that you want to speed up, but the tasks it performs. This is an important distinction. Speeding up the computer suggests buying a faster processor, installing faster memory, getting a faster bus, or installing faster disk drives and video controllers. Improving your hardware for the purpose of speeding up your system will work, if you keep the system uniformly balanced. (Remember, a single bottleneck will slow the performance of the entire system.) The lab you performed in section 2.1.3 Lab: Benchmarking might help you identify the bottlenecks, or slow spots, in your system.

The key to making effective improvements is to understand why certain tasks take so long. Often, you can do some simple experiments to see whether or not a certain item is the bottleneck. This idea is applied in a very straightforward way by software developers, who use profiling tools to measure how long various sections of their programs take. That way they can identify the bottlenecks and most time-consuming steps, and focus their attention on improving those portions of the code.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]