Previous Thread
Next Thread
Print Thread
Joined: Mar 2004
Posts: 664
Senior Member
OP Offline
Senior Member
Joined: Mar 2004
Posts: 664
Hello,
today I have, somewhat by accident, that optimization flags can have huge impact on performance of at least some drivers. As some of you might remember, I am packaging mame for Fedora. The package uses standard Fedora OPTFLAGS, which currently are:
Code
-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection

I have today compiled git master with --march=native (I am on Ryzen 5 2600) and standard -O3. Here are the results (first run is with packaged 0.214, second with --march=native -O3):
umk3 is almost 15 % faster:
Code
$ mame -window -noautosave -bench 120 umk3
Average speed: 546.00% (119 seconds)
$ ./mame64 -rompath /mnt/openmediavault/emu/mame/roms/  -window -nomaximize -bench 120 umk3
Average speed: 613.19% (119 seconds)

vf2, on the other hand, shows not much difference:
Code
$ mame -window -noautosave -bench 120 vf2
Average speed: 122.41% (119 seconds)
$ ./mame64 -rompath /mnt/openmediavault/emu/mame/roms/  -window -nomaximize -bench 120 vf2
Average speed: 126.37% (119 seconds)

Sadly in my case the speed gain is not there where one needs it most - on this machine vf2 hovers slightly above 90 % ingame. I just wanted to put it out there - if somebody needs to squeeze a couple percent out of a driver to get full speed, recompiling with more aggressive optimization flags might just do the trick.

Joined: Feb 2004
Posts: 2,217
Likes: 5
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,217
Likes: 5
Well yeah, -O3 attempts to optimise for speed at the expense of larger code size. If a relatively small proportion of the executable is actually used at any given time, that tends to be a win. Most of MAME isn't actually being executed for any given system, so we set -O3 by default.


Moderated by  R. Belmont 

Link Copied to Clipboard
Who's Online Now
1 members (Osso), 54 guests, and 2 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,879
Posts116,781
Members4,959
Most Online890
Jan 17th, 2020
Forum Host
These forums are hosted by www.retrogamesformac.com
Forum hosted by www.retrogamesformac.com