Is write-through better for gaming than write-back?

BoozeHobo

Member
Mar 23, 2017
30
7
21
I found this somewhere:
The benefit of write-through to main memory is that it simplifies the design of the computer system. With write-through, the main memory always has an up-to-date copy of the line. So when a read is done, main memory can always reply with the requested data.

If write-back is used, sometimes the up-to-date data is in a processor cache, and sometimes it is in main memory. If the data is in a processor cache, then that processor must stop main memory from replying to the read request, because the main memory might have a stale copy of the data. This is more complicated than write-through.

Also, write-through can simplify the cache coherency protocol because it doesn't need the Modify state. The Modify state records that the cache must write back the cache line before it invalidates or evicts the line. In write-through a cache line can always be invalidated without writing back since memory already has an up-to-date copy of the line.

One more thing - on a write-back architecture software that writes to memory-mapped I/O registers must take extra steps to make sure that writes are immediately sent out of the cache. Otherwise writes are not visible outside the core until the line is read by another processor or the line is evicted.
(I couldn't make heads or tails of the above, but it sounds experty)

In windows, if you go device manager, then disks, then pick the drive you're using, then go to the policies tab your disks always seem to be using "Better Performance", which means it's using write-back. To use write-through you'd have to instead set your disk to "Quick Removal". The only problem is windows 10 won't let me set it to Quick Removal, cause whenever I choose it Windows says it needs to restart to apply the changes but after the restart it always defaults back to Better Performance option.

I'm curious if write-through can have any benefits in many games where I get random intermittent stutters. Maybe using write-through will fix those?
 

Merad

Platinum Member
May 31, 2010
2,586
19
81
The quote is talking about RAM, not hard drives. Most modern CPUs contain a set of registers (16 on x86-64 processors) that store the values it is currently work with, and then three levels of of temporary memory (L1, L2, and L3 cache) that sit between the registers and RAM. L1 cache is very small and very fast, L2 is larger but slower, and L3 is larger but slower than L2. This is all done because accessing RAM is very, very slow compared to the speed of the CPU. The quote is referring to what happens when a value changes - the write through strategy means that the new value is immediately updated on all three levels of cache and is updated in RAM. In most cases write back is going to be the fastest approach by far, because write through requires writing main memory for every. single. write., and touching main memory is orders of magnitude slower than just writing to cache.

Anyway. Most games very rarely write to the hard drive except when you're saving your game. I would be extremely surprised if the setting you're asking about makes a measurable difference in game performance.
 
Reactions: BoozeHobo

BoozeHobo

Member
Mar 23, 2017
30
7
21
The quote is talking about RAM, not hard drives. Most modern CPUs contain a set of registers (16 on x86-64 processors) that store the values it is currently work with, and then three levels of of temporary memory (L1, L2, and L3 cache) that sit between the registers and RAM. L1 cache is very small and very fast, L2 is larger but slower, and L3 is larger but slower than L2. This is all done because accessing RAM is very, very slow compared to the speed of the CPU. The quote is referring to what happens when a value changes - the write through strategy means that the new value is immediately updated on all three levels of cache and is updated in RAM. In most cases write back is going to be the fastest approach by far, because write through requires writing main memory for every. single. write., and touching main memory is orders of magnitude slower than just writing to cache.

Anyway. Most games very rarely write to the hard drive except when you're saving your game. I would be extremely surprised if the setting you're asking about makes a measurable difference in game performance.
Just so I can be sure, is there a way to force windows to use write-through?
 

CountZero

Golden Member
Jul 10, 2001
1,796
36
86
The quote you gave lists only design time benefits to write-through, not a single performance benefit is mentioned. It offers design simplification not performance benefit (at least not in a typical system).

There is no way I can imagine windows would you let you change the way memory/cache is used at such a fundamental level. If such an option existed at all it would be at the BIOS level and I highly doubt it exists there.

To elaborate on why there isn't a performance help. Imagine the following:
Register takes 1 cycle per write
L1 takes 2 cycles per write
L2 takes 20 cycles per write
L3 takes 200 cycles per write
Main Memory takes 20000 cycles per write

Do you want to wait for 20000 cycles every time you write to memory?
 
Reactions: BoozeHobo

Merad

Platinum Member
May 31, 2010
2,586
19
81
Just so I can be sure, is there a way to force windows to use write-through?

No idea, I've never messed with that settings. That would probably be a better question for the operating system forum.

You're taking the wrong impression from the quote though. Write through is the simpler method, but it is slower - whether you're talking about memory or the hard drive.

There is no way I can imagine windows would you let you change the way memory/cache is used at such a fundamental level.

OP is referring to hard drive write caching settings, which are available through the drive's properties in device manager.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |