4 ms·
I 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
by localhost 8y ago
I 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 8y 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 8y 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 8y 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.