SLOW Performance Issues: post here to report

Having trouble with the game? Report issues and get help here. Read this first!

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
User avatar
Polaris
Posts: 104
Joined: March 25th, 2004, 3:30 pm
Location: Invincible Cyclones Of FrostWinds
Contact:

Post by Polaris »

Hello, I have been away from Wesnoth for quite some time, but today I downloaded version 1.1.8 for Windows XP (precompiled binaries). Apart from the great improvements that I have seen (last I tried version 1.1.3) I have to say that the whole game is __really__ slower.

I am not referring to any specific slowdown, just that the game feels slow. It seems that the engine is really heavy.

Anyway, my system configuration is this:
Intel P4 2.4 ghz + 800 Mhz bus
1,5 Gbyte ram
ATI radeon 9200 SE (128 mb)
Windows XP SP2
Single Antivirus + Firewall
No other application was running in the background while I was experiencing the global slowdown.

It seems that the binary that I am using was compiled with Microsoft Visual Studio 6, and from the binary code, it seems that it was compiled without the maximum optimization set.

Also, the code is full of assert calls, like this:

Code: Select all

.text:00407EF1                 push    0FCh
.text:00407EF6                 push    offset aCEntwicklungWe 
                             
           ; "C:\\Entwicklung\\Wesnoth\\wesnoth-1.1.8\\sr"...

.text:00407EFB                 push    offset aDefender_wea_0 

           ; "defender_weapon < (int)defender.attacks"...

.text:00407F00                 call    ds:_assert
There are 227 calls to that function, that results into the assert API function being called several thousands of times... Why you do not remove them? It will make the code faster for sure.

Also, you could switch to Microsoft Visual Studio 2005, it is MUCH better than VS 6, and by using the following combination for code optimization the result will be much faster:

Code: Select all

aggressive optimization
inline functions whenever possible
optimize for speed
enable global optimization
Also, I suggest the use of Intel VTune to track down performance bottlenecks - it is an excellent tool, and will highlight for sure the performance problems in Wesnoth.

Anyway, keep up the good job!!!
Standing With So Cold A Heart... Watching The Death Of The Sun...

torangan
Retired Developer
Posts: 1365
Joined: March 27th, 2004, 12:25 am
Location: Germany

Post by torangan »

First like often stated - non accelerated is slower by design. Animations do take longer.
Second, it seems like P4 for some reason is much slower then other archs. Don't know why.
I can't say wheter the binary was compiled with maximum optimization but I can say that compiling with Visual Studio 2005 isn't an option so far. There are some licence questions and the main problem are some redefinitions around the i18n system which prevent translations from working correctly.

Getting asserts out would be usefull for sure but what's to be done here needs to be determined by the Windows packager. As you seem to know quite a lot about compiling on Windows your help is surely welcome. We could use some more skill there, most developers are Linux/Mac people.
WesCamp-i18n - Translations for User Campaigns:
http://www.wesnoth.org/wiki/WesCamp

Translators for all languages required: contact me. No geek skills required!

User avatar
Polaris
Posts: 104
Joined: March 25th, 2004, 3:30 pm
Location: Invincible Cyclones Of FrostWinds
Contact:

Post by Polaris »

torangan wrote:First like often stated - non accelerated is slower by design. Animations do take longer.
Agreed, but the game should not give the feeling of slow.
torangan wrote:Second, it seems like P4 for some reason is much slower then other archs. Don't know why.
This should probably be investigated. Even MS VC6 allows for compiling for specific applications (there's no P4, but there is P3). Maybe this would solve the issue.
torangan wrote:I can't say wheter the binary was compiled with maximum optimization but I can say that compiling with Visual Studio 2005 isn't an option so far. There are some licence questions and the main problem are some redefinitions around the i18n system which prevent translations from working correctly.

Getting asserts out would be usefull for sure but what's to be done here needs to be determined by the Windows packager. As you seem to know quite a lot about compiling on Windows your help is surely welcome. We could use some more skill there, most developers are Linux/Mac people.
I really would like to help, but I lack time (and also, I am not a developer, I am a reverse engineer) - anyway, if the mantainer of the Windows version needs advice for designing better code optimizations strategies, I can help for sure.
Standing With So Cold A Heart... Watching The Death Of The Sun...

palloco
Posts: 136
Joined: April 3rd, 2004, 9:28 pm

Post by palloco »

AMD K6-III at 400 Mhz
Aopen Ax59Pro with 1024 KB L2 (L3)
256 MB Dimm SDRAM at 100 Mhz(128 + 2x64)
Seagate ATA 66 5400 rpm of 8,2 GB
Voodoo 3 3000 AGP
Sound Blaster PCI 128
NIC 3Com 3C905B-TX
Windows 98SE
Wesnoth 1.1.8, it is slow everwhere, but especially at menus(it is already slow in menus with 1.0.2). I remember that I could run wesnoth 0.8.3 on my 486, this new version almost reaches the unplayability level of 0.8.3 version on the 486.


Laptop Targa Visionary 811A
Athlon 64 Mobile 3000+
512 MB RAM
Samsung 60 GB 5400 rpm 8 MB
ATI Radeon Mobility 9700
Windows XP SP2
With 1.1.8, for example in the drowned quest, it takes some seconds to be able to select a unit to move it.

icer
Posts: 5
Joined: February 22nd, 2005, 7:01 pm

Post by icer »

Wesnoth version 1.1.8. System/compiler info below

Code: Select all

# emerge --info
Portage 2.1-r2 (default-linux/amd64/2006.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.17-gentoo-r5 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r5 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.12.4
ccache version 2.3 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib64/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="ftp://trumpetti.atm.tut.fi/gentoo/ http://trumpetti.atm.tut.fi/gentoo/ http://ftp.linux.ee/pub/gentoo/distfiles/ ftp://ftp.linux.ee/pub/gentoo/distfiles/ ftp://ftp.du.se/pub/os/gentoo http://ds.thn.htu.se/linux/gentoo "
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X a52 aac acpi alsa apache2 apm authdaemond avahi avi berkdb bidi bitmap-fonts cdda cdio cdr cli crypt cups dbus dlloader dri dvb dvd dvdr dvdread eds emboss emul-linux-x86 encode fam ffmpeg firefox flac foomaticdb fortran gd gdbm gif gnome gnutls gpm gstreamer gtk gtk2 hal howl httpd iconv ieee1394 imlib ipod ipv6 isdnlog jabber java jpeg libwww live lm_sensors lzw lzw-tiff mad matroska mp3 mpeg musicbrainz mysql mysqli mythtv ncurses njb nls nptl nptlonly nsplugin nvidia ogg opengl oss pam pcre pdflib perl png posix pppd python qt3 qt4 quicktime readline reflection samba sasl sdl session sockets spell spl ssl stream subtitles swat tcpd theora tiff truetype truetype-fonts type1-fonts udev unicode upnp usb v4l v4l2 vcd vhosts vlm vorbis wxwindows xinerama xml xorg xpm xscreensaver xv xvid xvmc zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux linguas_en userland_GNU video_cards_nvidia video_cards_vesa video_cards_fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, PORTAGE_RSYNC_EXTRA_OPTS
You're propably interested in the CFLAGS in the above list.

Theres 1GB memory in the system. I got a 10Mbit/s LAN connection to the Internet here. X: Xorg-X11-7.0, desktop: Gnome 2.14.

I can usually play sometime, maybe 30 minutes. Then it starts to get a bit slower but not much. Then I guess it's because save or load procedures which make the game 'lockup'. So try a lot of save and reload to reproduce the lockup. For me the lockup means that I must switch of to console and kill wesnoth-dev to get out of the situation.

There's just below 3GB free space on my HD. I dunno but it could be that theres swapping going on and that the diskspace might get used up? That's just because the HD is working alot when the computer is 'locked up' How much does a save game file(s) use disk space?
Emerge Victorious! USE = Gentoo linux

torangan
Retired Developer
Posts: 1365
Joined: March 27th, 2004, 12:25 am
Location: Germany

Post by torangan »

Savegames can use a bit of space but nowhere near the GB area unless you've got lots and lots of them. So your situation is that you get a lockup with heavy disk access after playing for about 30 minutes all the time? You can't reproduce it in another way? Sounds very strange and there's definitely something going very wrong...
WesCamp-i18n - Translations for User Campaigns:
http://www.wesnoth.org/wiki/WesCamp

Translators for all languages required: contact me. No geek skills required!

icer
Posts: 5
Joined: February 22nd, 2005, 7:01 pm

Post by icer »

I went to take a look at the save games folder. There was 804 save game files. They summed up to 800MB. Huh. I removed most of them.

Now I used top in console to see what's up. Both firefox an wesnoth consume a lot of memory. So I closed firefox. I usually have several tab's open in firefox. I guess that causes firefox to use more memory.

Well the game has'nt locked up now but it's too early to say anything definite. I observed wesnoth-dev using 34-37% of memory in top after firefox was closed. Now there's only 500MB of swap space on HD. I might need to increase the swap size because as a rule of thumb the distro docs recommend a swap partition of 1.5-2 times the amount of memory. Most of the swap space was being used according to top. However I wonder why the swap is being used in the 1st place. 1GB memory should be plenty. Well at least IMHO.
Emerge Victorious! USE = Gentoo linux

User avatar
ivanovic
Lord of Translations
Posts: 1146
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Post by ivanovic »

@icer:
Let me have a guess: you are using freetype 2.1.1. There is a *huge* memory leak in that version combined with wesnoth. Add freetype to your /etc/portage/package.unmask and make a system update. Afterwards you will not have any more problems with the ram usage due to freetype. It looks like the known patch for the memory leak in freetype did never find its way into portage like it did find its way into all debian based systems. So in short:

1) Open the file /etc/portage/package.unmask
2) Add this line:
media-libs/freetype
3) emerge -uaND world

This should update freetype to version 2.2.1 which is working perfectly for me. Don't ask me why the patch to fix the memleak was never backported to the "stable" freetype in gentoo. To have it fixed you have to use the currently hardmasked package.

icer
Posts: 5
Joined: February 22nd, 2005, 7:01 pm

Post by icer »

Ok. There's freetype 2.1.10-r2 in my system. I'm now switching to the masked one. Hopefully it helps. Thanks for suggesting that.

Edit:
Upgraded to the media-libs/fretype-2.2.1. So far no slow downs, touch wood. Well I'm glad if it turns out that there wasnt a bug in Wesnoth. :) If everything else works too I'll post to the Gentoo bugzilla and suggest they move the newer freetype into testing. Who knows if these posts help other people having similar issues. :)
Emerge Victorious! USE = Gentoo linux

Auria
Posts: 1
Joined: August 30th, 2006, 12:25 am

Post by Auria »

people seem to be reporting either massive slowdowns, or that "non accelerated is slower by design. Animations do take longer."

The first thing i noticed when trying 1.1.9 is that it was much less smooth than 1.0.2... It's not unplayable, but animations and movement "flickers" (english is not my first language and i'm not sure how to say it) horses look like they jump (like moving 5 pixels, then 2, then 5, then 2.)

And when scrolling around the map, i have the time to crearly see each frame sometimes - again it was perfectly smooth in 1.0.2. I guess some new addition must have slowed things down?

Also sometimes (but rarely) when clicking on a unit, it takes several seconds before the screen updates, showing which tiles it can access in one turn

Looking at the graphics i don't see anything much harder to draw than on 1.0.2, so i don't think this slowdown is normal :?

If there's a way i can help this just tell me

PingPangQui
Posts: 267
Joined: July 18th, 2006, 11:52 am

Post by PingPangQui »

I actually don't know where to put thus, but I think it fitts best here.

:lol: Thanks to anybody contributing to make the replay faster. :lol:

Now it is fun again joining other games. I had version 1.1.7 before and there it ws awful slow.

fyo
Posts: 29
Joined: September 7th, 2006, 9:56 am

Post by fyo »

On the topic of overall slowness:

I recently upgraded from 1.0 (binary) to 1.1.9 (compiled) and there is a noticable decline in scrolling speed and general "map update speeds". Overall responsiveness (selecting units, UI selections etc) are lower.

I'm playing on a Linux (Ubuntu) box with a 700MHz Duron (K7) and 256MB RAM. Yes, not exactly state-of-the-art.

One area that's noticably faster is the load-game screen. Wow. That's a huge improvement.

1.0 was the binary that is obtained via the Ubuntu repositories (Breezy Badger). 1.1.9 was compiled locally with no extra flags (what's the default optimization level?) and a butt-load of extra packages installed (libsdl and freetype, devs and dependencies).

The use of a different build environment completely blows the comparison, of course, and I guess I should compile 1.0 and experiment with it, but compiling on this POS system takes forever and I'm already in the process of compiling 1.1.8 so I can pick up the trident in HttT - Bay of Pearls.

I just have to add one thing: Wow. Nice job guys. Sweet game in 1.0, but 1.1.9 kicks ass. Graphics are so much better and certainly worth the slow-downs I've experienced thus far. Only minus is the AI, which seems to have developed a water-fetish and a few other kinks, making the game overall much easier than it would otherwise be (so nice of the AI in HttT - Bay of Pearls to send half its units arbitrarily into the water, allowing them to be decimated by my mermen).

torangan
Retired Developer
Posts: 1365
Joined: March 27th, 2004, 12:25 am
Location: Germany

Post by torangan »

With 1.1.9 you should get -O2 as default optimization but I'd suggest to add -march=X with X = k6-3 or athlon or athlon-xp depending on what the Duron is equivalent to.
Otherwise - don't worry so much about the AI bug, that one should be fixed. Until very recently the AI didn't like to attack without moving which put it into water rather often.
WesCamp-i18n - Translations for User Campaigns:
http://www.wesnoth.org/wiki/WesCamp

Translators for all languages required: contact me. No geek skills required!

qk
Inactive Developer
Posts: 57
Joined: September 4th, 2006, 5:47 pm
Location: Prague, CZ
Contact:

Post by qk »

another tip is compile it with gcc 4.1 rather then 3.4 (works good with 4.1). It improve speed of program by cca 10%.
I have PII 600MHz 256MB RAM and wesnoth 1.1.9 works really good.

Mellor
Posts: 29
Joined: January 28th, 2005, 10:02 pm
Location: UK

Post by Mellor »

BFW 1.1.9
Mac Powerbook G4 (17-inch screen)
1.33 GHz PowerPC G4 processor
512 MB DDR SDRAM
Mac OS X 10.3.9 operating system
DSL connection

When I try to select any of the multiplayer options, Wesnoth stalls for as little as ten minutes or for as long as I let it be -- up to an hour, before choosing to Force Quit. Once in MP, controls run very slowly -- up to a minute in delay.

Restarting BFW, rebooting my Mac, and reloading BFW do nothing to eliminate the slowdown.

The problem occurs every time, even in "Human vs AI." The slowdown does NOT occur in campaign mode.

Because the slowdown occurs before loading even multiplayer games, I have no saved file to send.

Thank you.

Post Reply