Yes, I understand. The reason why I ask is, both the game waiting for memory becoming available and having to write to HD would probably result in exactly the game slowing down a lot.
I've actually been theorizing that that's the cause, because the game seems to run with excellent speed on my laptop with a SSD compared to another computer of similar processor and RAM but 5400 RPM HD. Unless I'm just imagining it.
Hard drive is never used, thankfully. If Virtual Memory (using the hard drive instead of RAM) was ever used, you would
know it.
As far as I can tell, DF runs almost completely from memory during actual play with the exception of when it is tracking "off-board" units like historical figures, which it loads from the files in your save directory on the fly, and causes serious slowdown when it does. This, and load/save time would be the only times hard disk speed would ever matter.
The thing is, memory is about a million times slower than the CPU, which is exactly why DF lags so much - it crunches so much raw data that it can't store anywhere but in RAM because there is so much of it, that something close to 99.9999% of the cycle time is spent waiting on memory fetches.
Hard disks are significantly slower even than that, generally a hundred times slower, off the top of my head.
Anyway, items in this game have a data storage space-saving feature in the form of only recording items as pointers. This causes more waiting on memory fetches, but saves more memory overall, and is why the game is ever even capable of storing such huge amounts of items. The game basically stores an item without much data attached to it as a pointer to a "shape", such as "boulder" or "goblet", and a "material", both of which are only a single instance in memory that every item of that type or material all point back to in order to get their information.
Pointers are small. I always like to think of RAM as a giant filing cabinet system, each cabinet a number inside of a box which is labelled. A pointer doesn't actually contain real information inside of itself, it just tells you what cabinet to look in to get the information you need. This way, if it's a really large amount of information, you can just have everything point to the one large object, rather than storing a lot of data all over the place. You also only have to update a single object if you just have pointers to a single piece of data, and the pointers will still be pointing to the right object with the new data.
You would also need some extra pointers for special data, like how worn out clothes are, or decorations, and creator info, so any given individual object in memory would consist of only about 2-6 pointers (depending on how Toady set it up) in a container in this giant vector.
Because pointers are small, and you only need a couple pointers, it might only take 4 bytes of memory to store these things. Because this is a 32-bit system, the hard limit (that most computers have more than) of memory in this game is 2 GB of RAM... so we have roughly enough space for half a billion objects... and my extreme case test was only a million. (And it effin' killed FPS with the number of pointer traces it had to do, already.)
For reference, I kept Task Manager up when things really got going on the tests. Just running DF normally? 350 megs of RAM. (Remember, map data takes up a LOT of data, as it records around five million tiles in a standard embark, each taking up several bytes.) Running DF with a million boulders clogging the system? 550 megs of RAM. So, basically, 200 bytes total per item (across all the data structures and pointers that would be used) when you have a ceiling of 2 billion bytes of RAM. Of course, clothing items would take up more than a boulder, as has already been mentioned in this thread.