这是不同级别缓存的重要缓存命中率或缓存延迟率?为什么?

时间:2016-03-09 11:12:34

标签: caching

我们知道有一些缓存L1,L2,L3。当我们从L1升级到L3缓存级别时,哪个特性对于每个缓存更重要的缓存命中率或缓存延迟率以及原因。

1 个答案:

答案 0 :(得分:2)

两者都很重要,因为它们相互依赖。它们彼此成正比。

  

延迟率和缓存命中率随缓存内存的大小(级别)而增加。

L2的尺寸小于L3,而L3的尺寸小于L1。因此lines具有最小的大小,最低的延迟率和最低的缓存命中率。

为什么缓存命中率随缓存大小而增加?

缓存内存中blocks的数量越多,cache hit数据的数量就越多,lines的可能性就越大。

为什么延迟率会随着缓存大小而增加?

随着缓存内存中line的增加,电路变得复杂和密集。在缓存中搜索特定的 Core i7 Xeon 5500 Series Data Source Latency (approximate) local L1 CACHE hit, ~4 cycles ( 2.1 - 1.2 ns ) local L2 CACHE hit, ~10 cycles ( 5.3 - 3.0 ns ) local L3 CACHE hit, line unshared ~40 cycles ( 21.4 - 12.0 ns ) local L3 CACHE hit, shared line in another core ~65 cycles ( 34.8 - 19.5 ns ) local L3 CACHE hit, modified in another core ~75 cycles ( 40.2 - 22.5 ns ) remote L3 CACHE (Ref: Fig.1 [Pg. 5]) ~100-300 cycles ( 160.7 - 30.0 ns ) local DRAM ~60 ns remote DRAM ~100 ns 也会增加响应时间。

以下是Core i7 Xeon 5500缓存命中的估计延迟率表

找到https://software.intel.com/en-us/forums/intel-manycore-testing-lab/topic/287236

      public Vector LoadComPorts()
        {
                   int totalElements;
                    CommPortIdentifier portId;
                    Enumeration en = CommPortIdentifier.getPortIdentifiers();
                    Vector listData = new Vector(8);
                    // Walk through the list of port identifiers and, if it
                           // is a serial port, add its name to the list.
                    while (en.hasMoreElements())
                    {
                                portId = (CommPortIdentifier) en.nextElement();
                                if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL)
                                {
                                            listData.addElement(portId.getName());
                                }

                                           //
                                            //  listData.addElement("COM30"); //ADDEDLINE
                    }

                   //   listData.addElement("COM29"); //ADDEDLINE

                    totalElements = listData.size();

                    //Iterate through the vector
                    for (int index = 0; index < totalElements; index ++)
                    {
                                System.out.println(listData.get(index));
                    }

                    return listData;
        }

     public Vector LoadComPorts2() //addedline
        {
               Vector listData = new Vector(8);

                String[] portNames = SerialPortList.getPortNames();

                for (String port : portNames)
                {
                   listData.add(port);
                }


               return listData;
}