GNOME Bugzilla – Bug 118582
Do not use mmap for filesrc plugin.
Last modified: 2004-12-22 21:47:04 UTC
Please do not use mmap() for reading a file. According to Linus, with mmap() the actual reading is fast, but settting up the mmap() is slow, because it invalidates the cache used by the processor for the translation of virtual addresses to physical ones. So mmap is a good thing if you call it once in the program, and the read many, many times. It is also good for sharing the memory overhead of reading a file between several processes. However, if one is creating and destroying mmaps all over the time, that is quite slow.
Linus is talking about multiple opens per second, whereas your average media file takes quite a bit longer than a second, I hope. ;). However, for media tag parsing, this makes sense, yes.
Anyway, for now, close... It's a good idea to add read() support on the long term, but just not now... there's another bug for this already anyway. :). *** This bug has been marked as a duplicate of 117786 ***