Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Strange performance with Hyperthreading disabled  (Read 722 times)

Amharoth

  • Escaped Lunatic
    • View Profile
Strange performance with Hyperthreading disabled
« on: December 02, 2009, 02:43:43 pm »

Playing with 40d16, Mayday tileset, on an intel i7 quadcore PC.

Until recently I had been playing the game with hyperthreading on, such that my system recognized eight cores. I later realized this was probably stupid for DF, and that was confirmed in IRC, so I disabled HT and started DF up and... oddities. The game now seems to be stuck jumping between 35, 45, and 50 FPS (cap is set to 100), and the view stutters significantly when moving it. I've tried changing CPU affinities, priority level, print mode, etc, to no avail- the stutter is still there and my FPS refuses to go far over 45 FPS or under 35, whether I have 60 Dwarves pathing or 120.

This probably isn't a true bug for DF, but I'm new here and not sure where the proper tech forum is.
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Strange performance with Hyperthreading disabled
« Reply #1 on: December 02, 2009, 03:15:46 pm »

You can't get your FPS over 45 at all, even on the main menu or a fresh embark?  Have you tried turning HT back on?  As far as I know, HT is only "stupid" if it actually gives you a lower framerate.
Logged

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: Strange performance with Hyperthreading disabled
« Reply #2 on: December 02, 2009, 04:59:44 pm »

Hyperthreading is not stupid.
It allows one CPU core to run two threads.
It does not force one CPU core to run two threads.
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

Amharoth

  • Escaped Lunatic
    • View Profile
Re: Strange performance with Hyperthreading disabled
« Reply #3 on: December 02, 2009, 06:35:40 pm »

The FPS can go above 50- pausing does this, and it occaisionally spikes as high on it's own. I'd turn HT back on if I didn't think this was an issue fixable by other means; That the framerate stays consistent (usually around 45) no matter how many dwarves are pathfinding has me convinced.
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Strange performance with Hyperthreading disabled
« Reply #4 on: December 02, 2009, 06:41:57 pm »

What is DF's CPU usage like at that point?  Are you sure it didn't get set to a lower process priority by mistake?
Logged

Amharoth

  • Escaped Lunatic
    • View Profile
Re: Strange performance with Hyperthreading disabled
« Reply #5 on: December 02, 2009, 07:23:03 pm »

I'm positive; I tested it at normal priority, above normal, and realtime; No changes. The CPU usage is the weird part. The one core assigned to DF and nothing else is constantly maxed out with HT off; With it on, it would hover closer to 75%-85%. I'm getting a higher average FPS with it off- not by much, but the fact that it no longer goes as low as 25FPS when all 120 Dwarves are pathfinding is significant here. The problem is that it doesn't go any faster when they're not pathfinding, where before I could get 60FPS if I was lucky. I'm hoping that, given strange stuttering of the camera now, something else is causing this problem and that once rectified my FPS will be much, much better.

EDIT - Update; I reenabled HT and either I wasn't noticing this camera stutter before, or something else is causing it. Not much FPS difference; HT on seems to run 5FPS slower, if that. I had assumed that running HT off would further ensure an entire dedicated core for DF; I suppose I was mistaken.
« Last Edit: December 02, 2009, 08:31:01 pm by Amharoth »
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Strange performance with Hyperthreading disabled
« Reply #6 on: December 02, 2009, 09:42:31 pm »

Huh.  When you say the camera stutters, what exactly does that looks like?  Also, I almost hate to ask, but are your graphics drivers up-to-date?
Logged

Amharoth

  • Escaped Lunatic
    • View Profile
Re: Strange performance with Hyperthreading disabled
« Reply #7 on: December 02, 2009, 11:28:16 pm »

Well, instead of the usual, natural "stutter" inherent in a tileset game, this will hiccup- pause, then jump several gridlines and resume smooth movement. And I'll admit, I should probably check for the latest driver updates; Mine are from August. I can't imagine any game-changing improvements to their OpenGL rendering being developed in the last four months, though.
Logged

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: Strange performance with Hyperthreading disabled
« Reply #8 on: December 03, 2009, 01:12:20 pm »

HT will cause only a small drop in speed (as you saw), because it's primary function is to keep more parts of a cpu core busy at times they would otherwise be idle. For example, when the main "hardware thread" experiences a cache miss and has to wait 10ns (20-30 cpu cycles) or more for a ram read, the other hardware thread can use any of the rest of the cpu freely. Similarly, if one thread is using the floating point maths unit or SSE unit, the other can use the integer maths unit at the same time. This is not normally as big of a gain as it sounds like it should be, due to modern x86 CPUs' ability to reorder and parallelise instructions, so a single thread can theoretically have instructions using all the CPU units (integer, float, SSE etc) at once. Intel still claims a 30% boost in processing power if you actually use all the threads, but unless you actually do anything that maxes out your entire cpu you're probably better off with HT off.

Random trivia: The xbox360's three cpu cores each have two hardware threads, which give a lot more of a speed boost on its powerpc architecture than HT does on x86 due to the 360's cpu not supporting executing instructions out-of-order (meaning more of the cpu is idle at any time).


Stalls like you're seeing could be disk related, it's the only thing I can think of that would take a long time to respond. As Windows uses a page file on disk if you run out of ram, and DF can suck a lot of ram, you could just be out of ram.
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.