I read that mmap is more advantageous than fileinput because it reads the page in the kernel pagecache and shares the page in the user's address space. Whereas fileinput actually outputs the page to the kernel and copies the string to the user's address space. Thus, this is extra space with a file connection.
So, I plan to move on to mmap, but I want to know from advanced hackers, hackers, does performance improve?
If so, is there a similar fileinput implementation that uses mmap?
Please provide me with any open source code if you know.
Thank you
source
share