Author Topic: Poor performance in Linux  (Read 3959 times)

Offline BobHoward

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Poor performance in Linux
« on: June 06, 2016, 11:23:48 pm »
I've been playing TFTD with OpenXcom for a few months now. So far I've been playing on a decade old crappy laptop in WinXP, with no performance issues (framerate around 50 FPS, with occasional drops, no real problems). More recently I decided to give OpenXcom a try on another laptop: Intel Core i5-2450M, 4 GB RAM and Intel HD integrated graphics card. I'm using Slackware Linux 14.1, so with no nightlies available for that distribution I compiled from source.

The game works, but the performance is poor. While in Geoscape I have ~40 FPS, in Battlescape the framerate is ~30 FPS when nothing is happening, and drops to less than 15 when an unit is moving, shots are fired, etc. The more levels the map has, the worse the performance is: during cruise ship terror mission I only have ~5 FPS when I'm viewing the top level.

I'm playing at 1366x768 fulscreen, Battlescape and Geoscape scales are set to 1/2 Display, Display Filter is disabled (I tried various filters, which didn't help much). I'm not using any mods. Performance is still poor when the game is running in a window.

I tried the latest nightly build in Windows 7 on the same machine, and I had no performance issues there: constant 60 FPS. So the problem is either in OS, or with something that I did.

In Linux, I compiled the game like this:
1) clone git repo (at revision a617d7cbf11a6e117fa255520c3ca91f53440b6c)
2) mkdir build; cd build
3) cmake ..
4) ccmake .. [enable release]
5) make
6) make install

FWIW, here's some details:
Code: [Select]
~/soft/OpenXcom$ > cmake -L ..
found SDL 1.2.15 (/usr/lib64:/usr/include/SDL)
found SDL_mixer 1.2.12 (/usr/lib64:/usr/include/SDL)
found SDL_gfx 2.0.25 (/usr/lib64:/usr/include/SDL)
found SDL_image 1.2.12 (/usr/lib64:/usr/include/SDL)
found yaml-cpp(/usr/lib64:/usr/include/yaml-cpp;/usr/include/yaml-cpp/..)
git found: /usr/bin/git
version:1.0.
No doxygen command found. Disable API documentation generation
-- Configuring done
-- Generating done
-- Build files have been written to: /home/BobHoward/soft/OpenXcom/build
-- Cache values
BUILD_PACKAGE:BOOL=ON
CMAKE_BUILD_TYPE:STRING=
CMAKE_INSTALL_PREFIX:PATH=/usr/local
DATADIR:STRING=
DEBIAN_DEPENDENCYS:BOOL=OFF
DEPS_DIR:STRING=
DEV_BUILD:BOOL=OFF
DOXYGEN_EXECUTABLE:FILEPATH=DOXYGEN_EXECUTABLE-NOTFOUND
ENABLE_CLANG_ANALYSIS:BOOL=OFF
ENABLE_WARNING:BOOL=OFF
FATAL_WARNING:BOOL=OFF
FEDORA_DEPENDENCYS:BOOL=OFF
FORCE_INSTALL_DATA_TO_BIN:BOOL=OFF
MSVC_WARNING_LEVEL:STRING=3
OPENXCOM_VERSION_STRING:STRING=
SDLGFX_INCLUDE_DIR:PATH=/usr/include/SDL
SDLGFX_LIBRARY:FILEPATH=/usr/lib64/libSDL_gfx.so
SDLIMAGE_INCLUDE_DIR:PATH=/usr/include/SDL
SDLIMAGE_LIBRARY:FILEPATH=/usr/lib64/libSDL_image.so
SDLMAIN_LIBRARY:FILEPATH=/usr/lib64/libSDLmain.a
SDLMIXER_INCLUDE_DIR:PATH=/usr/include/SDL
SDLMIXER_LIBRARY:FILEPATH=/usr/lib64/libSDL_mixer.so
SDL_INCLUDE_DIR:PATH=/usr/include/SDL
SDL_LIBRARY:STRING=/usr/lib64/libSDLmain.a;/usr/lib64/libSDL.so;-lpthread
YAMLCPP_INCLUDE_DIR:PATH=/usr/include/yaml-cpp
YAMLCPP_LIBRARY:FILEPATH=/usr/lib64/libyaml-cpp.so

Did I miss something obvious? Is there any more info I can provide to help investigate this?

Offline R1dO

  • Colonel
  • ****
  • Posts: 442
    • View Profile
Re: Poor performance in Linux
« Reply #1 on: June 07, 2016, 02:38:09 am »
FWIW, here's some details:
Code: [Select]
~/soft/OpenXcom$ > cmake -L ..
CMAKE_BUILD_TYPE:STRING=

Something must have gone wrong with the ccmake command when setting release. Since the line above should say:
Code: [Select]
CMAKE_BUILD_TYPE:STRING=Release if you want to build with release optimizations on.

Offline BobHoward

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: Poor performance in Linux
« Reply #2 on: June 07, 2016, 09:05:29 pm »
I set CMAKE_BUILD_TYPE:STRING=Release. After recompilation the performance is much better.

My mistake was that I thought it was enough to set DEV_BUILD:BOOL=OFF.

I'll play and test some more, but I'm quite confident that was it. Thanks!
« Last Edit: June 07, 2016, 09:09:15 pm by BobHoward »

Offline R1dO

  • Colonel
  • ****
  • Posts: 442
    • View Profile
Re: Poor performance in Linux
« Reply #3 on: June 07, 2016, 10:12:25 pm »
Glad to see you're game has improved performance wise.

Enjoy your cyberdisk killing fields