RAM is much faster than a SSD, even a M.2 (NVMe) SSD.
A RAM disk (aka: RAM drive) uses a specified amount of your computer’s RAM as a very fast virtual drive for storage. You can use a RAM disk just like any other drive.
Some software or action performance can benefit from the extremely fast read and write speeds when it uses the RAM disk as storage or a cache.
You can use the free third-party ImDisk Toolkit software to create a RAM disk, and have the RAM disk automatically synchronize to a specified location of your choice at restart or shutdown.
This tutorial will show you how to create a RAM disk using ImDisk in Windows 10.