2 ms·
I assume if you force the file system to allocate inodes you are likely to have a less fragmented file than if you create a sparse file that gets inodes assigne
by wongarsu 4y ago
I assume if you force the file system to allocate inodes you are likely to have a less fragmented file than if you create a sparse file that gets inodes assigned over time when each part is used.
- theblazehen 4y agoWhich won't matter on SSDs
- wongarsu 4y agoOn all the benchmarks of SSDs I've seen they perform 1.5 to 4 times better on sequential reads than on random reads. That's a much better ratio than HDDs, but still enough to care about it. You're also likely to get less write amplification if your swap file is continuous. Of course with all the layers of indirection it's a numbers game, you don't know if your file system allocates adjacent inodes, and you don't know how your SSD will remap the blocks. But all else being equal, trying to make the file as sequential as possible seems preferable.
- olddustytrail 4y agoInteresting guess but wrong I'm afraid :) It's simply because it's an easy way to create a file of a certain size that most Linux users would be familiar with. The quicker way (and possibly more "proper" way) is to use fallocate, but who has even heard of that vs dd ?