Memory mapping does not make llvm faster (at least I don't see any difference).
It also allows llvm not to lock files which is sometimes quite important.
Details
- Reviewers
bkramer klimek ilya-biryukov
Diff Detail
Event Timeline
This looks strange. AFAIK, memory mapping files in Windows does no 'locking' by itself. I've just written a small program to check that it's possible to modify the file, memory-mapped using Win32 API.
What is specific problem you ran into?
The files might also be removed.
I checked that with qtcreator from git. Switching to the different branch started reparse of some files.
When I frequently switched branches back and forth I got lock issues. With mmap turned off this did not happen.
Renaming/removing memory mapped files also works fine.
What were those 'lock issues' specifically? MemoryBuffer code that uses the function you're changing seems to be doing the right thing by always allowing shared file access.
We definitely need a test case that realiably reproduces your issue.
The primary reason for using mmap is not so much performance, but reduced memory foot print.