Author davide.rizzo
Recipients davide.rizzo, inada.naoki
Date 2019-02-28.11:35:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551353725.5.0.161540056421.issue36139@roundup.psfhosted.org>
In-reply-to
Content
munmap() of private maps is usually pretty fast but not negligible (2 ms for 1GB). Shared maps are much slower. For some reason, shared maps explicitly backed by POSIX shared memory stand in between but are still pretty slow.

If someone cares about file-backed mmaps I can test those too. I thought this is already significant to justify releasing the GIL.


This is on Linux 4.4:


shared anon mmap 1048576 bytes
mmap time             6,393 ns
write time          449,062 ns
munmap time         100,205 ns
--
private anon mmap 1048576 bytes
mmap time             2,168 ns
write time          308,966 ns
munmap time          36,930 ns
--
posix shm + mmap 1048576 bytes
mmap time            13,299 ns
write time          369,305 ns
close time            1,545 ns
munmap time          26,759 ns
--

shared anon mmap 134217728 bytes
mmap time             4,641 ns
write time       64,508,536 ns
munmap time      13,592,556 ns
--
private anon mmap 134217728 bytes
mmap time             6,116 ns
write time       25,402,084 ns
munmap time         388,976 ns
--
posix shm + mmap 134217728 bytes
mmap time            29,034 ns
write time       66,826,645 ns
close time            3,707 ns
munmap time       3,475,977 ns
--

shared anon mmap 1073741824 bytes
mmap time            11,127 ns
write time      508,227,373 ns
munmap time      94,885,306 ns
--
private anon mmap 1073741824 bytes
mmap time             7,133 ns
write time      199,933,903 ns
munmap time       2,361,036 ns
--
posix shm + mmap 1073741824 bytes
mmap time            24,868 ns
write time      527,566,819 ns
close time            4,015 ns
munmap time      21,179,674 ns
--
History
Date User Action Args
2019-02-28 11:35:25davide.rizzosetrecipients: + davide.rizzo, inada.naoki
2019-02-28 11:35:25davide.rizzosetmessageid: <1551353725.5.0.161540056421.issue36139@roundup.psfhosted.org>
2019-02-28 11:35:25davide.rizzolinkissue36139 messages
2019-02-28 11:35:25davide.rizzocreate