From: Yusuke Endoh Date: 2014-01-08T00:31:00+09:00 Subject: [ruby-core:59632] Re: [ruby-trunk - Feature #9362][Assigned] Minimize cache misshit to gain optimal speed Hello, 2014/1/7 Urabe Shyouhei : > My experiment on valgrind clearly shows decreasing number of L1 data read > misshits. I can say that at least. Something is wrong. In principle, using more memory should make cache miss increase. In fact, when I replicate your experiment with "perf stat", the number of L1-dcache-load-misses increases about 1.5x: 3,846,577 -> 5,665,965. Note that the elapsed time does not change in spite of the increased cache misses. So, I think there is actually an improvement. But I guess it is not due to cache misses. There should be another reason. # trunk $ perf stat -e L1-dcache-load-misses -e cache-misses ./ruby --disable-gems -e "0x400000.times { Object.new }" Performance counter stats for './ruby --disable-gems -e 0x400000.times { Object.new }': 3,922,093 L1-dcache-load-misses 69,527 cache-misses 0.473115927 seconds time elapsed # shyouhei/cachelined $ perf stat -e L1-dcache-load-misses -e cache-misses ./ruby --disable-gems -e "0x400000.times { Object.new }" Performance counter stats for './ruby --disable-gems -e 0x400000.times { Object.new }': 5,644,399 L1-dcache-load-misses 82,589 cache-misses 0.473268687 seconds time elapsed -- Yusuke Endoh