emmap
emmap copied to clipboard
Add `auto_unlink` flag to delete the mapped file after data got gc'd
I'm using this functionality to speed up data transfer of big binary data via the file-based shared-memory area in /run/shm/... instead of sidio-based ports. I only transfer the path and the size of the binary in a tuple and mmap the file in direct mode.
With auto_unlink enabled, the file (and it's memory) is freed automatically when the binary gets gc'd.
With this transport I get a speedup of ~70% to stdio ports.