In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "what is CPU-intensive and IO-intensive". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
CPU intensive (CPU-bound)
CPU-intensive is also known as computing-intensive, which means that the performance of the hard disk and memory of the system is much better than that of CPU. At this time, most of the operating conditions of the system are that CPU Loading 100% CPU needs to read / write CPU Loading O (hard disk / memory), which can be completed in a very short time, while CPU still has a lot of operations to deal with, and CPU Loading is very high.
In a multiprogramming system, the program that spends most of its time doing CPU actions such as calculation, logical judgment and so on is called CPU bound. For example, a program that calculates pi below 1000 decimal places and spends most of its time on trigonometric functions and open root signs is a CPU bound program.
Generally speaking, CPU bound programs have a high occupancy rate of CPU. This may be because the task itself does not need to access the IWeiO device, or it may be because the program is multithreaded and thus shields the time waiting for IWeiO.
IO intensive (bound O bound)
IO-intensive means that the CPU performance of the system is much better than the hard disk and memory. At this time, the system is operating, most of the situation is that the CPU is waiting for the read / write operation of the hard disk O (hard disk / memory), and the CPU Loading is not high.
Generally speaking, the CPU occupancy rate of programs with O bound is still low when the performance limit is reached. This may be due to the fact that the task itself requires a large number of Icano operations, while pipeline does not do very well and does not make full use of the processor power.
CPU-intensive vs IO-intensive
We can divide tasks into compute-intensive and IO-intensive.
Computing-intensive tasks are characterized by a large number of calculations, consuming CPU resources, such as calculating pi, decoding video in high definition, and so on, which all depend on the computing power of CPU. Although such compute-intensive tasks can also be accomplished with multiple tasks, the more tasks, the more time spent on task switching, and the lower the efficiency of CPU in executing tasks. Therefore, to make the most efficient use of CPU, the number of compute-intensive tasks performed simultaneously should be equal to the number of cores of CPU.
Because computing-intensive tasks mainly consume CPU resources, the efficiency of code execution is very important. Scripting languages like Python are inefficient and completely unsuitable for computing-intensive tasks. For computing-intensive tasks, it is best to write in C language.
The second type of task is IO-intensive. Tasks involving network and disk IO are IO-intensive tasks. These tasks are characterized by low CPU consumption and spend most of their time waiting for IO operations to be completed (because the speed of IO is much slower than that of CPU and memory). For IO-intensive tasks, the more tasks, the more efficient CPU, but there is also a limit. Most common tasks are IO-intensive tasks, such as Web applications.
During the execution of IO-intensive tasks, 99% of the time is spent on IO and very little time is spent on CPU, so replacing a very low-running scripting language such as Python with the extremely fast C language does not improve the efficiency at all. For IO-intensive tasks, the most appropriate language is the one with the most efficient development (the least amount of code), scripting language is the first choice, and C language is the worst.
This is the end of "what is CPU-intensive and IO-intensive". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.