Is bigger CPU cache better? What pits have you stepped on?

Time:2020-8-23

In the CPU parameters, in addition to the common core threads and various frequencies, we often see a parameter called cache, some of which are 9mb, some are 16MB, and even 72mb on the third generation of sharp dragon. What is the purpose of these caches?

Is bigger CPU cache better? What pits have you stepped on?
3800X

Let’s talk about the concept first. The purpose of cache in CPU is to speed up the speed of CPU reading data, and also to give memory a buffer period. Because the CPU’s computing speed is too fast, it can’t keep up with the memory reading and writing alone, and the data exchange of CPU cache is much faster than that of memory. Most of the time, the CPU can directly read data from the cache, and if it can’t find it, it can read from the memory again, which can save the time wasted by the CPU when reading the memory data.

CPU cache is divided into three types: L1, L2 and L3. What we see now is a three-level cache. However, the most important thing for CPU in the actual data reading is the first level cache, because the first level cache is the fastest, the second level is the second level, and the third level cache is the slowest. Only the third level cache has the largest capacity, with hundreds of MB, it is easier to reflect the value of product update.

Is bigger CPU cache better? What pits have you stepped on?
CPU cache

Although the speed of the first level cache is the fastest, its capacity is the smallest, and the unit is KB. There is no difference between the first level cache of different CPUs, so I don’t mention it now. The capacity of the second level cache is not large, which is basically single digit MB. In addition to the fact that some server CPUs have more than 10 MB, the CPU does not mention Level 2 cache very much. When the CPU reads the cache, it starts from the first level cache, which is the second level cache. Sometimes, data miss occurs when reading the second level cache. At this time, it needs to read from the third level cache.

However, it should be noted that the larger the third level cache is, the stronger the CPU performance is. Because the capacity of the third level cache also depends on the influence of CPU architecture and technology. If the third level cache is upgraded with the architecture and technology, the greater the capacity, the higher the performance.

For example, this time, AMD’s three generations of Reebok, relying on zen2 architecture and 7Nm technology, has solved the memory delay problem of the first two generations. The actual effect is that the overall game performance of the three generations of Reebok has improved significantly.

Is bigger CPU cache better? What pits have you stepped on?
One core, one 16MB Level 3 cache

Generally speaking, the performance of CPUs between different processes and architectures can not be seen from the size of level 3 cache. It is not true that the larger the CPU size, the worse the performance. If it is the same architecture and the same process, we need to consider the problem of CPU Level 3 cache capacity. At this time, it is true that the larger the three-level cache capacity is, the better the performance will be. It is necessary to analyze the specific problems. There is no need to pay too much attention to the size of level 3 cache when purchasing, which is far less than the income of core thread and frequency.

Original text: http://diy.zol.com.cn/738/738…

Newly organized2TBTechnical dry goods: includingArchitect practice course, big data, docker container, system operation and maintenance, database, redis, mogodb, e-book, java basic course, Java practical project, elk stack, machine learning, bat interview intensive lecture videoEtc. You just need to「 Migrant workers’ technology road “WeChat official account dialog box replies to key words:1024All information can be obtained.

Is bigger CPU cache better? What pits have you stepped on?

Recommended Today

Proxy pattern of design pattern in JavaScript

1、 Definition When the client is inconvenient to directly access an object or does not meet the needs, provide an object to control the access of the heap object. 2、 Examples The implementation of lazy singleton mode depends on cache proxy 3、 Structure Proxy mode requires aOntology objectAnd oneProxy object. In the proxy mode, specific […]