Bay 12 Games Forum

Please login or register.

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

Author Topic: Just a little bit of cpu optimization? pretty please?  (Read 9588 times)

Random832

  • Bay Watcher
    • View Profile
Just a little bit of cpu optimization? pretty please?
« on: November 25, 2008, 08:49:53 pm »

There is no reason it should use an entire core while I am A) paused or B) on the menu screen; that's ridiculous. Also, lowering the FPS cap should also reduce CPU usage (as it does _nothing_ for the time that it could have been cranking out more frames than I want). You'd almost think it's doing a busy loop waiting for input instead of giving control to the operating system for even the tiniest fraction of a second.
Logged

Idiom

  • Bay Watcher
  • [NO_THOUGHT]
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #1 on: November 25, 2008, 10:41:56 pm »

It's busy cracking your passwords under your nose.

There's probably a good reason why such a simple fix has not been done yet. Also: keep your screen size at the minimum, turn off cave-ins, and try partial print.
Logged

Random832

  • Bay Watcher
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #2 on: November 25, 2008, 10:57:32 pm »

It's busy cracking your passwords under your nose.

There's probably a good reason why such a simple fix has not been done yet. Also: keep your screen size at the minimum, turn off cave-ins, and try partial print.

Absolutely nothing will make DF use less CPU - I can make it run faster, but I don't want it to run faster. I want it to use less CPU. I can get 99FPS, I want to use a third of that much CPU to get 33FPS. And I want it to use no CPU (or little enough not to matter) when paused.
Logged

Random832

  • Bay Watcher
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #3 on: November 26, 2008, 12:49:27 am »

If I or someone do this for Kobold Quest, will it help?
Logged

Capntastic

  • Bay Watcher
  • Greetings, mortals!
    • View Profile
    • A review and literature weblog I never update
Re: Just a little bit of cpu optimization? pretty please?
« Reply #4 on: November 26, 2008, 03:26:05 am »

I dunno if you can make a program limit itself to a certain amount of CPU, but if it's possible I imagine Toady would be able to do it.   Getting around to it is another matter, unless it's trivial to implement...
Logged

Random832

  • Bay Watcher
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #5 on: November 26, 2008, 08:22:45 am »

I dunno if you can make a program limit itself to a certain amount of CPU, but if it's possible I imagine Toady would be able to do it.   Getting around to it is another matter, unless it's trivial to implement...

That's not really what I'm asking for - what I'm asking for is basically for it to not use the CPU when it's not doing anything - there are almost no other programs that use an entire core at full-blast while doing absolutely nothing but waiting for keyboard input.
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #6 on: November 26, 2008, 11:23:54 am »

On my laptop (P4 2Ghz) DF hovers around 25% when paused, and drops to 1% on the Esc menu.  Don't know what to tell you.

It sounds like you're on a dual core?  Maybe it's something with how processor affinity works?  Regardless, if it's a problem, lowering the process priority to "Below Normal" should keep DF from murdering your other apps CPU-wise.
« Last Edit: November 26, 2008, 11:34:59 am by Footkerchief »
Logged

Align

  • Bay Watcher
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #7 on: November 26, 2008, 11:31:48 am »

10% or so at main menu for me, with a dual core. But that's still a bit odd - what could it possibly be doing at the main menu except idle?
Logged
My stray dogs often chase fire imps back into the magma pipe and then continue fighting while burning and drowning in the lava. Truly their loyalty knows no bounds, but perhaps it should.

Random832

  • Bay Watcher
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #8 on: November 26, 2008, 11:33:45 am »

It sounds like you're on a dual core?  Maybe it's something with how process affinity works?  Regardless, if it's a problem, lowering the process priority to "Below Normal" should keep DF from murdering your other apps CPU-wise.

Right, but it won't stop it from murdering my CPU fan.
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #9 on: November 26, 2008, 11:36:07 am »

Are you on a dual core?  Have you set processor affinity?
Logged

Random832

  • Bay Watcher
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #10 on: November 26, 2008, 11:55:32 am »

Are you on a dual core?  Have you set processor affinity?

How do I do that? Why should it matter considering I don't have to do it for any other program
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #11 on: November 26, 2008, 11:58:53 am »

Dude, are you on dual core or not?  <= not a rhetorical question

I wasn't TELLING you to set processor affinity, I was asking if you already had.  Sounds like the answer is no.  It's worth experimenting with, though.  This is how you can turn processor affinity on or off: http://articles.techrepublic.com.com/5100-10878_11-6168870.html
« Last Edit: November 26, 2008, 12:00:30 pm by Footkerchief »
Logged

Random832

  • Bay Watcher
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #12 on: November 26, 2008, 12:01:15 pm »

Dude, are you on dual core or not?  <= not a rhetorical question

yes.
Logged

Granite26

  • Bay Watcher
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #13 on: November 26, 2008, 12:50:21 pm »

I think that DF is a big program, using a lot of extremely memory intensive functions.

Given that it it not multi-threaded and that it is designed to compile on both Windows and Linux, I think that it is probably written in C or C++ (doesn't matter which) using very few external libraries, and certainly none of the OS optimizations.

The fact that it isn't multithreaded also says to me that there are a lot of deeper optimizations that aren't being done.  (That means things like OS sleeps and whatnot).

Basically, it's written by a game design genius (duh) and math professor(The low level stuff like flows is pretty phenominal), just not a computer scientist.

Random832

  • Bay Watcher
    • View Profile
Re: Just a little bit of cpu optimization? pretty please?
« Reply #14 on: November 26, 2008, 01:34:04 pm »

I think that DF is a big program, using a lot of extremely memory intensive functions.

Given that it it not multi-threaded and that it is designed to compile on both Windows and Linux, I think that it is probably written in C or C++ (doesn't matter which) using very few external libraries, and certainly none of the OS optimizations.

The fact that it isn't multithreaded also says to me that there are a lot of deeper optimizations that aren't being done.  (That means things like OS sleeps and whatnot).

Basically, it's written by a game design genius (duh) and math professor(The low level stuff like flows is pretty phenominal), just not a computer scientist.

I don't think that it's a "deeper optimization" to stop using the cpu when it's not doing anything. I think it's very basic. No other program that I've ever used gets this wrong (there are plenty that use an entire core or the whole CPU at a stretch, but only while they're actually doing something)

(Incidentally, it is presumably written in C++ based on the fact that he's said Kobold Quest uses the same basic engine and that's C++, and there is no Linux version)
Logged
Pages: [1] 2 3 ... 6