cache vs ramdisk Topic is solved

FAQ, getting help, user experience about PrimoCache
Post Reply
bwana
Level 2
Level 2
Posts: 8
Joined: Mon Apr 23, 2012 1:04 am

cache vs ramdisk

Post by bwana »

please forgive this naive question but i need a clear understanding of the difference between these two pieces of software. Since they both use ram to store data that would otherwise be written to disk, are they not the same?

I guess the main difference is that the ramdisk is actually saved to the HD periodically? Whereas the ramcache is just where you accumulate a bunch of little disk operations to reduce the number of disk accesses. What really boggles my mind tho is the following example
Say you are editing a photo and periodically saving changes to it. The cache is working in the background accumulating those changes and only writing to the HD when a certain size is reached(?). Suppose you click on a part of the image that is not in ram (it's not uncommon to have multi gigabit photos these days) The OS goes to the HD to retrieve that part of the image- but what about all the changes to the photo that are still in ram? Since you havent actually issued a 'save' command, nothing has been written. How does the primo cache combine the data in the ram with the data the OS retrieves from the HD?
InquiringMind
Level SS
Level SS
Posts: 477
Joined: Wed Oct 06, 2010 11:10 pm

Re: cache vs ramdisk

Post by InquiringMind »

Simplest answer - a Ramdisk only contains data you put on it, so can only improve performance if you take the time to (a) identify files/folders used frequently and (b) copy them across to the ramdisk and make any configuration changes needed to ensure the ramdisk version is used (e.g. using links or NTFS junctions to point to the Ramdisk using Link Shell Extension, changing Registry settings or modifying .ini files depending on the data in question). The ramdisk is only saved to hard disk if you have created an image file though - this doesn't happen by default.

A cache on the other hand, will store any data accessed and therefore should provide "some" performance improvement in almost any situation ("some" being highly variable though). However Windows does include its own cache (which still operates with Primo Cache active) so the significant theoretical advantages have to be balanced against the fact that Windows does a good part of this anyway. There are advantages to Primo Cache (more control over memory usage and algorithm, ability to use unmanaged memory on both 32- and 64-bit systems, able to cache files even with FILE_FLAG_NO_BUFFERING set and the option to defer writes for longer) so it may be worth considering how significant these may be for your situation.

With regards to your specific example of photo editing, if using Primo Ramdisk no changes would be saved unless that ramdisk had been set up with an image file (if so, various options for saving data are available - see Primo Ramdisk Features - Image File for details). With Primo Cache on the other hand, all changes would be saved (as with a standard disk) unless write-defer is enabled, in which case write-defer will delay saves for the amount of time specified (10 seconds by default). Write defer is needed for significant write speed improvements, but does increase the chance of data loss.
bwana
Level 2
Level 2
Posts: 8
Joined: Mon Apr 23, 2012 1:04 am

Re: cache vs ramdisk

Post by bwana »

tnx. I appreciate the time you took to explain the tip of the iceberg. it is a murky subject.
User avatar
RAMbo
Level 6
Level 6
Posts: 73
Joined: Wed May 11, 2011 7:50 am

Re: cache vs ramdisk

Post by RAMbo »

The drawback of a RAMdisk is that you have to make a choice what to put on it. It should be filled with files that are most frequently accessed. A very simple theory that's very hard to figure out.
It's often quite hard to figure out which files are accessed most often. I would say impossible without special monitoring software. Cache software just caches what Windows wants to read or write so that's a major benefit. Cache software requires just a 'few' Mbyte to speed up a 4TB harddisk while a RAMdisk can only speed up what you put on.
My personal approach that likely isn't best for everyone is to get truckloads of RAM in your PC. Switch of Windows virtual memory. That already saves lots of disk access. If you have apps that constantly trash the HD with 1000's of small temp files I would create a RAM disk for that temp directory. Then the remaining RAM you can spare you devote to FancyCache.
While doing so keep in mind write actions are slowest so I would configure the program with that in mind. Also pick the HD that has most access, unless you have lots of RAM to spare.
You should also know if your system mostly reads or writes. That knowledge can also be used to optimize Fancy cache settings.

So..... figuring out the correct settings takes more time than you save :-)
Post Reply