View Issue Details

IDProjectCategoryView StatusLast Update
0010052Dwarf FortressTechnical -- Generalpublic2018-02-23 15:52
Reporteralexchandel Assigned Tolethosor  
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
OSOS XOS Version10.12.0 
Product Version0.43.05 
Summary0010052: DF uses 57% in PRINT_MODE:2D with 640x300 window, over 100% when maximized
DescriptionRunning the current version of dwarf-fortress on the current version of macOS/OSX with the default settings results in a steady 57% usage. Maximizing the window results in over 100% usage.

This persists even when a world is loaded & paused, and even with sound disabled. Based on the description of 2D print mode, there's no reason this abhorrent CPU usage should exist.

This is severe because without 2D print mode on OSX, the crash from 0009762 occurs. It's possible both issues are related, and emanate from the ancient version of SDL that DF uses.
Steps To Reproduce1. Start DF 0.43.05 on macOS 10.12.0
2. Observe 57% CPU usage on the menu and in-game.
TagsNo tags attached.

Relationships

has duplicate 0011152 resolvedlethosor Input lags on fullscreen 
related to 0011680 confirmedlethosor Game window is blank on macOS 11 

Activities

alexchandel

2016-10-26 13:40

reporter   ~0036003

Note that 2D is the only mode that uses 57-100% CPU, and changing to SINGLE_BUFFER:YES makes no difference.

lethosor

2016-11-24 22:52

manager   ~0036062

Are you using the 64-bit build (which comes with SDL 1.2.15) or the 32-bit build (SDL 1.2.13, last I checked)?

This is almost certainly an SDL 1.2 issue Toady can't fix, in any case.

alexchandel

2017-04-25 15:00

reporter   ~0036465

The 64-bit build, version 0.43.05 for OS X, which comes with SDL 1.2.14 according to its Info.plist, but SDL 1.2.15 according to its SDL_version.h.

This can't be a wholly SDL issue, as there are plenty of SDL 1.2.x games that don't use 100% CPU when maximized.

alexchandel

2017-04-25 15:19

reporter   ~0036466

Last edited: 2017-05-12 10:05

I switched to PRINT_MODE:TEXT for now, which works fantastic. (when using "bright colors for bold text" per 0010054. I didn't realize DF used ANSI 8-colors with bold rather than 256-colors in text mode.)

Has Toady ever attempted updating to SDL 2? I know the video functions have changed somewhat, but given that so much of DF code is mechanics and so little video, shouldn't the upgrade be relatively manageable? As long as PRINT_MODE:TEXT still exists afterwards.

lethosor

2017-04-29 11:50

manager   ~0036477

Last edited: 2017-04-29 11:50

The fact that this doesn't occur on OS X 10.11 implies to me that it's a compatibility issue with SDL 1.2 and macOS 10.12. SDL 1.2 is ancient, so I wouldn't expect it to work well on on newer macOS versions.

Does PRINT_MODE:STANDARD work? That's typically been better in terms of performance for me.

Also, the SDL version in SDL_version.h (1.2.15) is the right one.

alexchandel

2017-05-12 10:04

reporter   ~0036526

Last edited: 2017-05-12 10:05

PRINT_MODE:STANDARD and other OpenGL modes do work.

It would be nice if 2D modes worked though, since OpenGL modes don't support truetype fonts.

Interestingly the new SDL build from 0009762 doesn't fix this issue. Is there an open bug for updating to SDL 2?

lethosor

2017-05-17 14:07

manager   ~0036535

There is not, but not using SDL 2 is not a bug by itself, so please don't report it here.

Toady wasn't the person that wrote the SDL code, by the way, so it wouldn't be easy for him to update.

alexchandel

2017-12-16 20:35

reporter   ~0037336

Last edited: 2018-02-16 11:39

Just tested, still happens in 44.02 and macOS 10.13 (even with Mifki's SDL build).

alexchandel

2018-02-16 11:39

reporter   ~0037797

Interestingly, this doesn't happen with TWBT (v0.44.05, Mifki's SDL build).

lethosor

2018-02-16 14:42

manager   ~0037798

That's because TWBT is PRINT_MODE:STANDARD (TWBT in init.txt, but DF defaults that to STANDARD).

jecowa

2018-02-23 15:52

reporter   ~0037825

Last edited: 2018-02-23 15:52

Just did some testing of this on 2013 desktop computer with 64-bit 0.44.05 on Mac OS X 10.12 Sierra.

Default Window size, 2D Print: 16.1% - 16.9% CPU usage
Default Window size, STANDARD Print: 7.6% - 8.0% CPU usage


Maximized Window size (not full screen), 2D Print: 27.4% - 27.9% CPU usage
Maximized Window size (not full screen), STANDARD Print: 81.0% - 81.2% CPU usage


And for comparison, some testing on 2008 laptop computer with 64-bit 0.44.05 on Mac OS X 10.7 Lion:

Default Window size, 2D Print: 15.4% - 16.3% CPU usage
Default Window size, STANDARD Print: 12.0% - 13.4% CPU usage


Maximized Window size (not full screen), 2D Print: 53.2% - 61.7% CPU usage
Maximized Window size (not full screen), STANDARD Print: 44.0% - 45.2% CPU usage

Add Note

Note

Issue History

Date Modified Username Field Change
2016-10-26 13:08 alexchandel New Issue
2016-10-26 13:40 alexchandel Note Added: 0036003
2016-11-24 22:52 lethosor Note Added: 0036062
2016-11-24 22:52 lethosor Assigned To => lethosor
2016-11-24 22:52 lethosor Status new => feedback
2017-04-25 15:00 alexchandel Note Added: 0036465
2017-04-25 15:00 alexchandel Status feedback => assigned
2017-04-25 15:19 alexchandel Note Added: 0036466
2017-04-29 11:50 lethosor Note Added: 0036477
2017-04-29 11:50 lethosor Status assigned => feedback
2017-04-29 11:50 lethosor Note Edited: 0036477
2017-04-29 11:53 lethosor Description Updated
2017-05-12 10:04 alexchandel Note Added: 0036526
2017-05-12 10:04 alexchandel Status feedback => assigned
2017-05-12 10:05 alexchandel Note Edited: 0036526
2017-05-12 10:05 alexchandel Note Edited: 0036466
2017-05-12 10:05 alexchandel Note Edited: 0036466
2017-05-17 14:07 lethosor Note Added: 0036535
2017-05-17 14:07 lethosor Status assigned => acknowledged
2017-12-16 20:35 alexchandel Note Added: 0037336
2018-02-16 11:39 alexchandel Note Added: 0037797
2018-02-16 11:39 alexchandel Note Edited: 0037336
2018-02-16 14:42 lethosor Note Added: 0037798
2018-02-23 15:52 jecowa Note Added: 0037825
2018-02-23 15:52 jecowa Note Edited: 0037825
2019-10-05 13:55 lethosor Relationship added has duplicate 0011152
2021-01-28 17:06 lethosor Relationship added related to 0011680