RAM File System benchmarks

We measured RAM File System performance against the likely alternatives on each platform: Windows, macOS and Linux. Every platform was tested on one computer in one session, each figure is the median of several runs, and the charts include the tests where RAM FS did not win. The figures are not comparable between platforms, because the computers and the tools are different.

Windows

Compared with SoftPerfect RAM Disk formatted as NTFS, and a Samsung 990 PRO NVMe SSD, on an Intel Core i9-13900KS and 96 GB of memory, running Windows 11 24H2 with Windows Defender real-time protection off.

RAM FS NF is a RAM FS volume with the Do not attach filters option of Windows 11, which keeps antivirus, backup, cloud and indexing filters off the volume. The trade-off is that files on such a volume are not scanned in real time.

Reading and writing files through the cache

Buffered throughput, which is how ordinary applications read and write. Single thread, GB/s, higher is better.

Sequential, 1 MiB blocks

QD8 read
SSD 6.6
RAM Disk 8.6
RAM FS 49.1
RAM FS NF 50.0
QD8 write
SSD 7.1
RAM Disk 7.1
RAM FS 59.7
RAM FS NF 65.0
QD1 read
SSD 9.1
RAM Disk 9.4
RAM FS 19.5
RAM FS NF 19.9
QD1 write
SSD 7.2
RAM Disk 7.1
RAM FS 43.0
RAM FS NF 43.7

Random, 4 KiB blocks

QD32 read
SSD 1.4
RAM Disk 1.4
RAM FS 2.9
RAM FS NF 4.9
QD32 write
SSD 1.3
RAM Disk 1.4
RAM FS 3.5
RAM FS NF 5.8
QD1 read
SSD 1.8
RAM Disk 1.8
RAM FS 3.3
RAM FS NF 6.2
QD1 write
SSD 1.6
RAM Disk 1.5
RAM FS 4.0
RAM FS NF 7.2

The SSD and the RAM Disk are almost equal in their performance, because both are served by the Windows file cache rather than by the device. RAM FS does not use that cache and serves files straight from memory, so it is 2–8× faster than either.

Direct I/O, bypassing the cache

Unbuffered throughput, which is what disk benchmarks such as CrystalDiskMark measure. Single thread, GB/s, higher is better.

Sequential, 1 MiB blocks

QD8 read
SSD 7.1
RAM Disk 46.5
RAM FS 50.1
RAM FS NF 50.6
QD8 write
SSD 6.7
RAM Disk 66.8
RAM FS 68.4
RAM FS NF 68.1
QD1 read
SSD 3.1
RAM Disk 13.1
RAM FS 20.1
RAM FS NF 20.3
QD1 write
SSD 4.3
RAM Disk 24.3
RAM FS 43.0
RAM FS NF 43.9

Random, 4 KiB blocks

QD32 read
SSD 0.7
RAM Disk 2.0
RAM FS 3.7
RAM FS NF 4.9
QD32 write
SSD 1.0
RAM Disk 1.9
RAM FS 3.4
RAM FS NF 6.0
QD1 read
SSD 0.1
RAM Disk 2.2
RAM FS 4.6
RAM FS NF 6.2
QD1 write
SSD 0.1
RAM Disk 2.0
RAM FS 4.0
RAM FS NF 7.9

Without the cache, the RAM Disk is a much closer rival. It is level with RAM FS on large queued sequential transfers, while RAM FS is 50–80% faster on single-stream ones and about 2× as fast on small random I/O. The SSD is furthest behind on single random reads, where its latency holds it to about 12,500 operations per second while RAM FS answers over a million.

Working with many files

Extracting, copying and deleting a source tree of 600,000 files, about 10 GB. Seconds, lower is better.

Extract 600,000 files
SSD 94.0 s
RAM Disk 82.2 s
RAM FS 41.0 s
RAM FS NF 25.9 s
Copy the tree, 32 threads
SSD 58.2 s
RAM Disk 48.8 s
RAM FS 5.0 s
RAM FS NF 4.3 s
Delete the tree
SSD 32.4 s
RAM Disk 22.9 s
RAM FS 6.2 s
RAM FS NF 3.2 s

Creating, opening and deleting files is quicker too, not just reading and writing them. The copy is furthest ahead, about 10× quicker, because a copy within the same volume shares memory with the original instead of duplicating it. Extracting is partly limited by the processor, which has to decompress the archive whichever drive it lands on, so the gap there is narrower.

macOS

Compared with Apple's tmpfs, a RAM disk made with hdiutil and formatted as APFS, and the internal SSD, on a Mac mini with an Apple M2 and 16 GB of memory running macOS 27.0.1.

Reading and writing files through the cache

Buffered throughput, which is how ordinary applications read and write. One file, GB/s, higher is better.

Sequential, 1 MiB blocks

QD8 read
SSD 31.7
RAM disk 37.2
tmpfs 37.7
RAM FS 55.7
QD8 write
SSD 13.2
RAM disk 9.42
tmpfs 35.7
RAM FS 39.5
QD1 read
SSD 19.8
RAM disk 19.2
tmpfs 20.1
RAM FS 45.3
QD1 write
SSD 1.64
RAM disk 12.7
tmpfs 16.0
RAM FS 35.0

Random, 4 KiB blocks

QD64 read
SSD 5.62
RAM disk 5.60
tmpfs 5.73
RAM FS 5.01
QD64 write
SSD 1.33
RAM disk 0.74
tmpfs 3.63
RAM FS 3.64
QD1 read
SSD 4.37
RAM disk 4.33
tmpfs 4.49
RAM FS 5.45
QD1 write
SSD 1.80
RAM disk 0.91
tmpfs 2.53
RAM FS 2.09

RAM FS leads on sequential transfers, by more than 2× on a single stream. On random 4K I/O the field is closer: reads from the SSD and the RAM disk come from the macOS file cache, so they match tmpfs, and tmpfs is ahead of RAM FS by 13–17% on single random writes and on heavily queued random reads.

Direct I/O, bypassing the cache

Unbuffered throughput, which is what disk benchmarks such as AmorphousDiskMark measure. One file, GB/s, higher is better.

Sequential, 1 MiB blocks

QD8 read
SSD 1.60
RAM disk 24.1
tmpfs 37.7
RAM FS 55.6
QD8 write
SSD 4.35
RAM disk 12.7
tmpfs 35.4
RAM FS 39.5
QD1 read
SSD 1.31
RAM disk 18.6
tmpfs 20.0
RAM FS 45.4
QD1 write
SSD 1.46
RAM disk 23.0
tmpfs 15.9
RAM FS 35.0

Random, 4 KiB blocks

QD64 read
SSD 0.62
RAM disk 0.95
tmpfs 5.73
RAM FS 5.01
QD64 write
SSD 0.07
RAM disk 0.40
tmpfs 3.62
RAM FS 3.65
QD1 read
SSD 0.06
RAM disk 0.39
tmpfs 4.47
RAM FS 5.42
QD1 write
SSD 0.03
RAM disk 0.28
tmpfs 2.52
RAM FS 2.11

RAM FS is ahead of the RAM disk in every test, by up to 14× on small random I/O. Against tmpfs it leads by more than 2× on single-stream sequential transfers and is level on heavily queued random writes, while tmpfs is ahead by 13–16% on heavily queued random reads and on single random writes. The SSD is furthest behind on single random reads: about 14,800 operations per second against 1.3 million on RAM FS.

Working with many files

Extracting, copying and deleting the Linux 6.12 kernel source: 92,000 files and folders, about 1.5 GB. Seconds, lower is better.

Extract 92,000 files
SSD 8.2 s
RAM disk 7.6 s
tmpfs 5.6 s
RAM FS 5.3 s
Copy the tree
SSD 11.1 s
RAM disk 11.1 s
tmpfs 8.7 s
RAM FS 7.8 s
Copy the tree as clones
SSD 6.7 s
RAM disk 6.5 s
tmpfs 10.9 s
RAM FS 5.0 s
Delete the tree
SSD 3.3 s
RAM disk 2.9 s
tmpfs 2.4 s
RAM FS 1.8 s

RAM FS is quickest at all four. The margins are smaller than in the throughput tests because most of the time goes on creating and removing tens of thousands of small files, not on moving data.

RAM FS advantages over macOS tmpfs

tmpfs is close on raw speed, but it is a bare scratch area. RAM FS is a complete file system that additionally offers:

  • Transparent compression that fits more data in the same amount of memory.
  • Reflink copies: Finder duplicates and cp -c are clones that share the original's memory. tmpfs has no clones, so a copied tree takes 2× the memory.
  • Persistence: a volume can be saved to an image file, mounted at start-up with its contents and saved automatically. A tmpfs volume is lost when it is unmounted.
  • Folder mirroring runs an existing folder in memory under its own path and writes the changes back to the disk.

Linux

Compared with tmpfs, a kernel RAM disk (brd) formatted as ext4, and an SSD, on a laptop with an Intel Core i7-5600U and 8 GB of memory running Kubuntu 24.04. This is a modest, older computer, so the absolute figures are low. What matters is how the targets compare with each other.

Reading and writing files through the cache

Buffered throughput, which is how ordinary applications read and write. One file, GB/s, higher is better.

Sequential, 1 MiB blocks

QD8 read
SSD 6.06
RAM disk 7.92
tmpfs 7.39
RAM FS 7.57
QD8 write
SSD 3.08
RAM disk 3.21
tmpfs 4.52
RAM FS 7.09
QD1 read
SSD 1.22
RAM disk 1.80
tmpfs 7.17
RAM FS 10.7
QD1 write
SSD 0.87
RAM disk 1.48
tmpfs 6.34
RAM FS 9.46

Random, 4 KiB blocks

QD64 read
SSD 4.47
RAM disk 5.34
tmpfs 7.01
RAM FS 7.03
QD64 write
SSD 1.79
RAM disk 2.13
tmpfs 3.68
RAM FS 6.40
QD1 read
SSD 0.05
RAM disk 2.35
tmpfs 2.84
RAM FS 3.13
QD1 write
SSD 1.75
RAM disk 1.91
tmpfs 2.59
RAM FS 3.09

RAM FS is ahead of or level with tmpfs in every test: by about 50% on single-stream sequential transfers, by 55–75% on writes from many threads, and level on reads from many threads. The RAM disk falls well behind on most of them, because its data is held twice: once in the page cache and once in the disk.

Direct I/O, bypassing the cache

Unbuffered throughput, which is what disk benchmarks such as KDiskMark measure. One file, GB/s, higher is better.

Sequential, 1 MiB blocks

QD8 read
SSD 1.58
RAM disk 7.16
tmpfs 8.77
RAM FS 8.82
QD8 write
SSD 0.89
RAM disk 6.70
tmpfs 5.15
RAM FS 8.03
QD1 read
SSD 1.05
RAM disk 7.16
tmpfs 8.06
RAM FS 11.5
QD1 write
SSD 1.14
RAM disk 6.39
tmpfs 6.67
RAM FS 10.2

Random, 4 KiB blocks

QD64 read
SSD 0.65
RAM disk 3.85
tmpfs 6.94
RAM FS 7.13
QD64 write
SSD 0.40
RAM disk 3.39
tmpfs 3.70
RAM FS 6.35
QD1 read
SSD 0.04
RAM disk 1.69
tmpfs 2.85
RAM FS 3.16
QD1 write
SSD 0.15
RAM disk 1.55
tmpfs 2.71
RAM FS 3.08

RAM FS is again ahead of or level with tmpfs in every test, by 43–53% on single-stream sequential transfers and 56–71% on writes from many threads. It is 20–100% faster than the RAM disk throughout. The SSD is furthest behind on single random reads: about 10,800 operations per second against 770,000 on RAM FS.

Working with many files

Extracting, copying and deleting the Linux 6.12 kernel source: 92,000 files and folders, about 1.5 GB. Seconds, lower is better.

Extract 92,000 files
SSD 3.6 s
RAM disk 3.3 s
tmpfs 2.1 s
RAM FS 1.9 s
Copy the tree in full
SSD 4.1 s
RAM disk 4.3 s
tmpfs 2.3 s
RAM FS 2.1 s
Copy the tree, default
SSD 3.4 s
RAM disk 4.5 s
tmpfs 2.0 s
RAM FS 1.1 s
Delete the tree
SSD 1.6 s
RAM disk 1.6 s
tmpfs 0.5 s
RAM FS 0.4 s

RAM FS is quickest at all four. Its default copy is a clone that shares the original's memory, so it is about 2× quicker and takes no extra space: the copied tree left 1.8 GB in use on RAM FS and 3.3 GB on tmpfs, which has to duplicate every file.

RAM FS advantages over Linux tmpfs

tmpfs is close on raw speed, but it is a bare scratch area. RAM FS is a complete file system that additionally offers:

  • Transparent compression that fits more data in the same amount of memory.
  • Reflink copies: an ordinary cp is a clone that shares the original's memory. tmpfs has to duplicate every file.
  • Persistence: a volume can be saved to an image file, mounted at start-up with its contents and saved automatically. A tmpfs volume is lost when it is unmounted.
  • Folder mirroring runs an existing folder in memory under its own path and writes the changes back to the disk.

Where RAM FS shows no significant gain, and why

Work limited by the processor rather than by storage finishes in about the same time on every target. Compiling code is the obvious example: the bottleneck is the CPU, not the disk. RAM FS helps wherever storage is the critical point. When instead the processor is the limit, there is little left for faster storage to improve.

That said, a build is still worth pointing at RAM FS. Compilers and linkers produce many short-lived intermediate files, and keeping those in memory spares your SSD the constant writing and deleting. Keeping temporary files off your permanent storage can prolong the drive's life and reduce the clutter.

Further reading