Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: RAM Clock and CAS latency vs DF FPS  (Read 5571 times)

g1real

  • Bay Watcher
    • View Profile
RAM Clock and CAS latency vs DF FPS
« on: July 02, 2012, 07:58:27 pm »

I honestly do not know a better place to discuss this than in a forum full of lovable chubby men with beards on their necks.

A few days ago I came to the shocking conclusion that someone said that not CPU but RAM is the bigger bottleneck to dwarf fortress. And me being as wary as it is and about to build a new PC anyway, I decided to go overkill on them both. But the CPU is out of the question right now, and I'm really posting here to discuss the possibilities of fast RAM:

I have two options, one is 1866 MHz RAM with a CAS of 8, resulting, according to wikipedia's article on cas latency and my own added calculations, to 8,576 nanoseconds delay, or 1/116604 of a second delay. This is for 8 bytes, the first 8 (64 bits are returned per burst apparently)
Option two is 2133 MHz RAM with a CAS of 11, resulting in 10,318 nanoseconds of delay for the first 8 bytes.

Here's the clue however, and this rabbit hole might go too deep for anyone here. I might have to consult a real hardware expert, or Toady might be able to explain (if he replies that is). Consecutive data is accessed at 0,536ns (Yes indeed that is over 1.8 millionth of a second, are we breaking any physical laws yet?) per 8 bytes as far as I can gather

Would it be more efficient to go for the faster initial access time, because dwarf fort makes a huge amount of small requests.
Or is it more efficient to go for the faster continuous time, because dwarf fort makes many requests, but some are clusters larger than 28 words (224 bytes), resulting in a speed gain?

For your viewing pleasure, here's a table that might give you more insight in my calculations.
Spoiler (click to show/hide)

Feel free to correct me if I got anything wrong in all this.
Logged

King Mir

  • Bay Watcher
    • View Profile
Re: RAM Clock and CAS latency vs DF FPS
« Reply #1 on: July 02, 2012, 10:06:43 pm »

Go for the CAS 8. The time to send 64 bytes is the clincher.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: RAM Clock and CAS latency vs DF FPS
« Reply #2 on: July 03, 2012, 07:23:11 pm »

Someone would need to profile DF's cache performance in order to answer this properly.  Even then there's probably more information needed to really give a complete answer, but here's an extremely high level explanation:

The lower access latencies will benefit programs that have more cache misses more, while the higher clock rate would presumably mean a higher bandwidth and thus better overall performance unless the RAM has to do a lot of random accesses.

The question comes down to how often DF has cache misses.  If it does a good job keeping data in the processor cache (it probably does), then I suspect that the CAS 11 RAM with higher clock rate and bandwidth will be the winnder.  If the cache gets trashed often, then the CAS 8 RAM could demolish the CAS 11 RAM.  It just all depends.

In the end, I suspect you wouldn't notice too much difference between the two really.  I would be highly interested in seeing someone profile DF's cache performance though.  I don't know what the best way to do that would be.  On Linux you might could use Valgrind's cache profiler, but I've never tried that on something like this, nor do I have any idea how accurate it is
Logged
Through pain, I find wisdom.

g1real

  • Bay Watcher
    • View Profile
Re: RAM Clock and CAS latency vs DF FPS
« Reply #3 on: July 04, 2012, 08:43:13 am »

Useful replies, especially the second one.

I've delayed purchase of new RAM so far myself, but I think it's still an interesting subject to research for performance in DF.

Logged

malvado

  • Bay Watcher
    • View Profile
Re: RAM Clock and CAS latency vs DF FPS
« Reply #4 on: July 06, 2012, 09:48:02 am »

Personally I would :

1 : Go for Option two : which is 2133 MHz RAM with a CAS of 11.
2 : Test first at 2133 MHZ RAM by generating a world with a set population and then working up an fortress to a certain stage of development.
3 : Underclock the Memory to 1800 and CAS 10 first, if its prime95 stable (or passes a few memtest86 rounds) go down to CAS 9 then CAS 8, It will probably out of the box be either CAS 9 or 10 stable at those speeds and might even have no need of adjustments of Voltage to it to work at those speeds.

Now load up the save at 1800 speed and best stable CAS latency and record the average fps over some time, then switch back to 2133 and CAS 11 and check the difference.
Logged