Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4]

Author Topic: Advanced Tweaking (Warning: !!SCIENCE!!)  (Read 5810 times)

Rysith

  • Bay Watcher
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #45 on: September 30, 2010, 10:08:25 am »

Disclaimer:  I know nothing of CS.

That said, it seems like this issue is relatively easy to address.  Is there a reason to count constructed blocks and stone?  Is there a reason to query the status of objects not in use as frequently as objects currently being used?  Coverings that are easier to clean or that eventually decay would help.

If I had one wish for the future of DF it would be framerate improvement.  Lag has killed more forts than gobbos ever could.  It would be great to have succession games that could last more than 6-8 turns before becoming unplayable.

If the primary reason behind the framerate decline really is volume of memory access, then I'd guess that it's things like "A dwarf walks past a building. The building must go check to see what material it is made out of, to determine what thought, if any, the dwarf gets out of it". So yes, there are definitely reasons to keep checking constructed blocks and stone.

However, profiling memory accesses is a reasonably easy thing to do (compared to, say, rewriting DF to support multiple threads), and it seems likely that with some well-planned caching there could be some significant improvements. Maybe a project similar to the graphics improvement project is in order?
Logged
Lanternwebs: a community fort
Try my orc mod!
The OP deserves the violent Dwarven equivalent of the Nobel Peace Prize.

motorbitch

  • Bay Watcher
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #46 on: September 30, 2010, 01:08:21 pm »



I have the right to suggest for you to go or to leave because you're making the environment of the thread worse.
do i? pointing you onto bad but popular mistakes dosent make this thread worse. leaving them uncommented would ;)
[/quote]
Logged

janglur

  • Bay Watcher
  • +Blood Soup+
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #47 on: September 30, 2010, 02:52:33 pm »

Well, I do notice a .13/.14 vs. .12 speed change.  I beleive that the game may also track the amount of crap going on in the world too, which would explain why equal-sized embarks on different worlds are not usually linear in performance.  But this can also be related to underground geography, temperature, weather, and Z-heights.  It's a very, very hard area to nail down.


But there is an undeniable increase in RAM use and accesses when your fort has a metric crapton of crap.  I'm currently testing to see if this applies to specific objects.  Namely, i'm doing a megaproject fort entirely out of constructed stone blocks to eliminate as many items as possible, and see if walls contribute to this clutter, or only constructed walls, or only specific objects (like loose clutter, and maybe crafts)

I'm building a 100 crafts workshop long corridor to bench the before and after performance to try and see if RAM accesses increase from thought-checks or if it's just a pathfinding coincidence.

This is all fuzzy math.
Logged

decius

  • Bay Watcher
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #48 on: October 04, 2010, 09:17:37 pm »

Windows 7, AMD Phenom 2 X6   64 bit processor
ASUS MB, Radeon HD 5830 GPU (in case that matters)

RAM:DDR3 1333 8192MB (2x4096MB)

Test save: First winter, 9 dorfs, merchants, a page and a half of units, less than 1k items including stone in z-stocks. I think it's a 5x5 embark, but I could be wrong. I've dug to the first cavern and I'm playing around in there.


Intial settings (factory default): NB freq 2000.1 MHz DRAM freq 666.7
Timing 9-9-9-20-33, unganged. 27 FPS

First change: Ganged: 27 FPS. Other programs had a noticable effect.

Second change: unganged, 8-8-8-18-28. This was the lowest timing that passed POST. FPS 29.

Third (final) change: bumped the freq to 678.0 MHz, NB 2034.0 MHz, 9-9-9-24-30. This is the result of a BIOS auto-optimize, and I didn't expect the FSB and CPU changes it made. I don't have real before and after numbers, but processing performance showed a moderate gain. DF performace showed a remarkable gain: 44 FPS, roughly a 50% performance increase.

And yes, % change from original is a proper metric. 27-30 FPS is the same gain as 90-99 FPS,even though the MS/frame difference is not the same.

Current conclusion: I was limited by CPU cycles, not RAM speed. Anyone have a few benhmark forts, different sizes, number of creatures, items, and jobs? I suspect that things like large embarks, kittens, and designating 2k stones for dumping might stress the system in different ways.
« Last Edit: October 04, 2010, 11:07:25 pm by decius »
Logged
TBH, I think that all dwarf fortress problem solving falls either on the "Rube Goldberg" method, or the "pharaonic" one.
{Unicorns} produce more bones if the werewolf rips them apart before they die.

daishi5

  • Bay Watcher
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #49 on: October 05, 2010, 11:31:41 am »

I see a lot of talk on Virtual Memory, so I thought I should point everyone who wants to know more to http://blogs.technet.com/b/markrussinovich/archive/2008/11/17/3155406.aspx

Basic overview, yes removing the pagefile can help some programs that are having data paged out, but you are playing computer system chicken.  Your system can crash horribly if it runs out of RAM and has no pagefile.  With a pagefile, Dwarfortress slows down when it starts to run out of physical memory.  Without a pagefile, some random program crashes when you start to run out of physical memory, and it would probably be DF. 
Logged

janglur

  • Bay Watcher
  • +Blood Soup+
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #50 on: October 05, 2010, 12:04:07 pm »

here, decius.  This is one of my tests forts.  Download it HERE:  http://207.177.39.129/save.rar
Let it run for a full 2 minutes before taking the FPS reading.  Remember, it averages!
This is a .15 save (genned in .12)
All features ON.  No elves.  Flux+Steel+sand+magma+river.  Goblin ambushes (no invasions yet)
Year 13, 75 dwarves.  Over 50,000 clutter.
Compressed in WinRAR.  May not work in other clients, but feel free to try.  It gets better compression than zip, 7z, etc

Here's my specs:
AMD Phenom II X3 (2.8 GHz)
2000 MHz NB
4 GB (2x2GB) DDR2 1066 MHz (5-5-5-15-30-2T timings)
ASRock AOD970GX

Default:  31 FPS
Default with single-core DF:  40 FPS
Default with dedicated single-core DF:  44 FPS   [We'll abbreviate this as "DDSC"]
DDSC CPU overclocked to 1.6/1.6/3.4 GHz:  49 FPS
DDSC CPU overclocked to 2.6/2.4/3.4 GHz:  51 FPS
DDSC+CPU-OC plus FSB bumped from 200 to 212 (RAM is now 1129 MHz, CPU 3.6 GHz):  51 FPS
DDSC+CPU-OC with FSB set to 227 and RAM down to 800 (making 912 MHz RAM, CPU 3.42 GHz*) and 4-4-4-15-30-2T timings:  57 FPS
DDSC+CPU-OC as above, with HT set from 2000 MHz to 1600 MHz:  56 FPS
Same as above but 1200 MHz:  56 FPS
Setting pagefile to on (680 MB across 3 drives):  59 FPS
Setting pagefile to 3 GB (1GB per drive):  55 FPS

* At a much higher FSB, the max CPU core speed also dropped, forcing me to drop a couple multipliers.  Despite this, performance still raised considerable.  I kept the other cores as close to 2.6 and 2.4 GHz as possible)
« Last Edit: October 05, 2010, 12:06:36 pm by janglur »
Logged

helf

  • Bay Watcher
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #51 on: October 05, 2010, 12:25:09 pm »

Download URL isn't working. Firefox keeps giving me timeout errors on it.
Logged
YOUR GAMES GLITCH: Hey, I got out of the map boundry!
OUR GAMES GLITCH: Hey, a horrid monstrosity just migrated to my fortress! Let's recruit it!

NKDietrich

  • Bay Watcher
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #52 on: October 05, 2010, 12:30:28 pm »

Download URL isn't working. Firefox keeps giving me timeout errors on it.

Yeah I was going to download and test it out FOAR SCIUNTZ too, but it stalled out on me.
Logged

decius

  • Bay Watcher
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #53 on: October 05, 2010, 01:30:19 pm »

janglur: I'm not getting the file either.

It seems that you are CPU limited as well... I'm gonna check out how much I can bump the speed and voltage on the CPU.

I suspect that my monitoring software is having a noticable efffect, but I'm not willing to lose the real-time temp monitoring because I'm paranoid. For the record, my current all-time CPU temp record is 24 C, and my current temp is 16 C- which is slightly below what the weather service has for outside air temp, and I'm not cooling the house. I think I might have a little room to play with here.

If I don't respond for a week or so, I might have invented the magma CPU.
Logged
TBH, I think that all dwarf fortress problem solving falls either on the "Rube Goldberg" method, or the "pharaonic" one.
{Unicorns} produce more bones if the werewolf rips them apart before they die.

tps12

  • Bay Watcher
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #54 on: October 05, 2010, 02:59:38 pm »

If you've got a low amount of memory i guess use it, but if you've got an abundance it's better to make the most use of it possible, and XP at the very least DOES not always make full use of your memory. If it used up every bit of your memory then switched to virtual, i'd be happy, but it doesn't. And i've noticed the difference in performance since i've turned it off, particularly on using Eclipse for big projects and Civ4.

"Use all physical memory first" is a pretty brain-dead strategy, since when you approach the limits of your physical memory, any new allocation is going to require a swap before it can proceed. Whatever XP does might be even worse, of course.

Eclipse performance is interesting...possibly the JVM and OS working at cross purposes?
Logged

decius

  • Bay Watcher
    • View Profile
Re: Advanced Tweaking (Warning: !!SCIENCE!!)
« Reply #55 on: October 05, 2010, 05:03:05 pm »

Moderate overclocking (from 4x200=800MHz to 14x230=3220MHz) had roughly the expected effect: FPS up to about 70-77; the comparison isn't strictly fair, as during the test period an immigration wave arrived and population went from 9 to 31.

Any differences from changing priority from normal through realtime, or from setting affinity between 1,2 or 6 CPUs are less than the variation within each setting.

Multi-core processors have at least one major advantage over single-core. As I was writing this post, my armorer made "Aval Alek, The Loves of Humor" a billon chain leggings studded with billon.

Unless anyone has experience otherwise, I'm going to suggest that early-game slowdowns tend to be CPU related. Unless I see slowdown, combined with lowered cpu usage, I won't think RAM speed is a factor. Results might vary with slower RAM, of for anyone who has a more reasonable amout of RAM than I do.
Logged
TBH, I think that all dwarf fortress problem solving falls either on the "Rube Goldberg" method, or the "pharaonic" one.
{Unicorns} produce more bones if the werewolf rips them apart before they die.
Pages: 1 2 3 [4]