logoalt Hacker News

Asmod4ntoday at 3:56 PM3 repliesview on HN

I found out that using mmap and just telling uring to read form there to beat anything else.


Replies

megagpt1today at 4:24 PM

Databases vendors usually find that read outperforms mmap. Mmap being fast is a myth.

show 2 replies
marginalia_nutoday at 3:59 PM

Depends a lot on the memory pressure. If you can be fairly certain the data is (or will be) resident in memory, mmap is basically unbeatable. If you can't (because the data is larger than RAM or there's other stuff competing for RAM), mmap can have gnarly system-wide performance implications[1].

[1] Mandatory mmap=poop-emoji link: https://db.cs.cmu.edu/mmap-cidr2022/

show 1 reply
0c3ca83today at 4:00 PM

Why would you use uring to read from an mmap? Couldn't you just memcpy?

show 2 replies