4 ms·
Which is wrong. Video Games don't actually make very many kernel system calls. Meltdown / Spectre patches have virtually no effect on video games. The majority
by dragontamer 9y ago
Which is wrong. Video Games don't actually make very many kernel system calls. Meltdown / Spectre patches have virtually no effect on video games.
The majority of DirectX stuff in the innermost-loops automatically DMAs to the video card without even needing a kernel call. Video games care a lot about performance and did their best to never touch kernel-space anyway.
Compilers, Web Servers, Databases, etc. etc. were affected very strongly. Compilers open files. Web Servers open Sockets. Databases communicate with mutexes / semaphores. All of these are OS-level features and require a kernel-mode switch. Meltdown means that every kernel-mode switch clears out the TLB-cache.
So each time a compiler opens a file (MMap or otherwise), it basically loses its entire TLB cache. Every. Single. System call. That's why its a big deal for servers, but not a big deal for video games.
- lightedman 9y ago" Meltdown / Spectre patches have virtually no effect on video games." The amount of speculative-execution that games rely upon for many of their components is insane. With the patch applied, I went from a solid 60FPS at 1440x900 in GTAV down to about 48 FPS (as measured by the Steam FPS counter) on a 7th-gen i3.
- localhost 9y agoI wonder if moving to a different file format for compilation might minimize the impact of this? For example, what if source code were stored as a single SQLite file? What impact would that have?
- dragontamer 9y agoIf anything, it'd be slower. SQLite locks the database file (which would be another OS-level system call). Simple files are more straightforward. You do one MMap and then there wouldn't be any other system calls made. I'd bet that compilers are "slow" because they have to make many, many, many mmaps to do anything. Each #include turns into another MMap, which Meltdown mitigations cause a full TLB flush each time.
- Ded7xSEoPKYNsDd 9y agoMmap uses page faults instead of syscalls to read more data. Both these mechanisms require switching to the kernel and back, so it's not clear to me why it should be less affected by Meltdown patches.
- SQLite 9y agoFor reading many blobs of approx 10KB each, it is often faster to read them out of an SQLite database than from separate files on disk. See https://sqlite.org/fasterthanfs.html https://sqlite.org/fasterthanfs.html for details and to download code that you can use to test this yourself on your system. I don't know if SQLite would be faster or slower in the context suggested here. But I'd like to suggest that perhaps it is worth running the experiment before reaching a conclusion.