←back to thread

150 points shaunpud | 2 comments | | HN request time: 0.001s | source
Show context
ars ◴[] No.45060177[source]
File is tmpfs will swap out if your system is under memory pressure.

If that happens, reading the file back is DRAMATICALLY slower than if you had just stored the file on disk in the first place.

This change is not going to speed things up for most users, it will slow things. Instead of caching important files, you waste memory on useless temporary files. Then the system swaps it out, so you can get cache back, and then it's really slow to read back.

This change is a mistake.

replies(3): >>45060209 #>>45060221 #>>45061213 #
1. marginalia_nu ◴[] No.45061213[source]
This doesn't really make sense. If /tmp was an on-disk directory the same memory pressure that caused swapping would just evict the file from the page cache instead, again leading to a cache miss and a dramatically slower read.
replies(1): >>45067152 #
2. ars ◴[] No.45067152[source]
Reading it back from a filesystem is much much faster than reading it back from swap.