3 ms·
> You want to abstract two different kinds of file reader: an mmap reader and a regular reader. We already do this. Small files aren't mmap'd in Sublime Merge
by ben-schaaf 8y ago
> You want to abstract two different kinds of file reader: an mmap reader and a regular reader.
We already do this. Small files aren't mmap'd in Sublime Merge and instead copied into memory.
> I say this because if the file is coming via the network or a FAT32 partition you’re not going to save much time with mmap relative to the read speed anyways.
Speed in this case was the absolute least of our concerns. mmap was used to deal with large files without refactoring large parts of the codebase. Not using it for networked files doesn't fix the memory usage issue.