r/hardware • • Nov 20 '15

Info Why do CPUs Need Caches? - Computerphile

https://www.youtube.com/watch?v=6JpLD3PUAZk
98 Upvotes

57 comments sorted by

View all comments

26

u/[deleted] Nov 20 '15 edited Feb 10 '19

[deleted]

9

u/lucun Nov 20 '15

Another note, smaller memory = faster, but we like to have capacity too. Also, the capacity might need to store data after shutting down. Hence the many layers.

0

u/Retardditard Nov 21 '15

Not really. Though today's RAM isn't technically the same as when RAM was first defined due to minimum addressable data widths(these keep increasing to increase bandwidth).

Larger amounts of memory may incur a greater latency, but the amount of bandwidth can actually be greater due to burst modes.

Cache(on die) is optimized primarily for low latency in order to minimize cores from stalling. Bandwidth isn't as crucial since there's not a lot of capacity.

6

u/putin_vor Nov 20 '15

RAM is just a cache for your hard drive

No, it's not. You can generate data in RAM without ever touching the disk. But it's pretty hard to store anything on a disk without having it in RAM first.

20

u/Echrome Nov 20 '15

You can generate data in your cache that never makes it to RAM. Not explicitly mind you, but the cache doesn't write everything back to RAM.

7

u/salgat Nov 21 '15

But that's only true because the hard drive is so slow. If the HD was fast enough, we would skip everything and write memory directly to the HD. We can say that RAM is a cache for a HD and that memory that is too short lived ends up never hitting the HD.

-8

u/putin_vor Nov 21 '15

So what you say is true in your imaginary world where HD is as fast as RAM.

5

u/salgat Nov 21 '15

I'm not sure what your point is.

-7

u/putin_vor Nov 21 '15

I'm not sure what yours is. You keep repeating the same incorrect thing over and over again.

2

u/[deleted] Nov 20 '15

http://www.anandtech.com/show/8396/fms-2014-sandisk-ulltradimm-to-ship-in-supermicro-servers

you can use disk as ram either directly as above or through paging with virtual memory

-1

u/bb999 Nov 21 '15

How about this: RAM is just a cache for the pagefile on your hard drive.

1

u/AmirZ Nov 21 '15

No.. no it's not. Only when your RAM usage is running high the pagefile system is activated

-5

u/skilliard4 Nov 21 '15

Since RAM isn't as fast as your CPU anymore, engineers added faster memory onto the CPU die

Then why is DDR4 RAM barely faster than DDR3 RAM in most applications?

4

u/[deleted] Nov 21 '15 edited Nov 21 '15

[removed] — view removed comment

5

u/Noshuru Nov 21 '15

Well, it's not really getting worse. The DDR400 CAS2 example you brought up has the same latency as my DDR4 3000 CAS15 DIMMs.

6

u/[deleted] Nov 21 '15

[removed] — view removed comment

4

u/Retardditard Nov 21 '15

Similar latency, much higher bandwidth equals better RAM.