On Thu, Dec 20, 2012 at 01:54:25PM +0000, Edd Barrett wrote:
> Hi,
> 
> Having been pretty unsatisfied with the performance of fs-uae (and
> emulators in general) on OpenBSD, I asked upstream what I could do to
> make it run faster and rid of jerky screen updates and frame drops. If
> you press ctrl+f10 in fs-uae it displays diagnostics. I sent upstream a
> screenshot. Surprisingly the slowness is not a symptom of slow graphics
> rendering, but rather of cpu core emulation.
> 
> I experimented by cranking the optimiser to -O3 for fs-uae only.  I
> wasn't expecting much of a difference, but in this particular case it
> makes a big difference. It makes some of the more demanding amiga games,
> like pinball dreams and pinball fantasies usable on OpenBSD (even with
> the accuracy knob set to the highest).
> 
> Now, I know we don't usually like to turn the optimiser up past -O2 for
> fear of compiler bugs making crappy code, however, the code gcc has made
> in this case for my amd64 machine seems to be ok.
> 
> I spoke to Jasper on icb about the possibility of making exceptions. We
> came to the conclusion that we could allow exceptions for selected
> ports (I guess where latency/lag is critical) as long as we test
> carefully.

FYI there are already ports that do this.

> We could:
>  * Turn on -O3 unconditionally for selected ports.
>  * Turn on -O3 for selected ports on a subset of architectures.
>  * Make -O3 package flavours for selected ports.
>  * Any other suggestions?
> 
> I prefer one of the first two options.
> 
> What do people think? Are any of the options acceptable?
> 
> Below is a diff that makes fs-uae listen to CFLAGS and CXXFLAGS and
> unconditionally turns on -O3. Try twhat we have in tree and then using
> the diff an older machine (say an x61).
> 
> If you do testing, please let me know how you get on.
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/emulators/fs-uae/Makefile,v
> retrieving revision 1.5
> diff -u -p -u -r1.5 Makefile
> --- Makefile  7 Dec 2012 08:43:06 -0000       1.5
> +++ Makefile  20 Dec 2012 13:19:23 -0000
> @@ -6,7 +6,7 @@ COMMENT =             modern Amiga emulator
>  V =                  2.0.1
>  DISTNAME =           fs-uae-$V
>  CATEGORIES =         emulators
> -REVISION =           1
> +REVISION =           2
>  
>  HOMEPAGE =           http://fengestad.no/fs-uae/
>  MAINTAINER =         Edd Barrett <e...@openbsd.org>
> @@ -34,7 +34,12 @@ RUN_DEPENDS =              devel/desktop-file-utils 
>                       x11/py-wxPython
>  
>  USE_GMAKE =          Yes
> -MAKE_FLAGS +=                prefix=${PREFIX}
> +
> +# We don't usually crank the optimiser up this high, but
> +# if you don't it really impacts emulation performace.
> +CFLAGS =             -O3 -pipe
> +CXXFLAGS=            ${CFLAGS}
> +MAKE_FLAGS +=                prefix=${PREFIX} CXXFLAGS="${CXXFLAGS}" 
> CFLAGS="${CFLAGS}"
>  
>  NO_REGRESS =         Yes
>  
> Index: patches/patch-libfsemu_Makefile
> ===================================================================
> RCS file: /cvs/ports/emulators/fs-uae/patches/patch-libfsemu_Makefile,v
> retrieving revision 1.1.1.1
> diff -u -p -u -r1.1.1.1 patch-libfsemu_Makefile
> --- patches/patch-libfsemu_Makefile   22 Nov 2012 23:45:20 -0000      1.1.1.1
> +++ patches/patch-libfsemu_Makefile   20 Dec 2012 13:19:23 -0000
> @@ -1,9 +1,9 @@
>  $OpenBSD: patch-libfsemu_Makefile,v 1.1.1.1 2012/11/22 23:45:20 edd Exp $
>  
> -Missing libpng flags
> +Missing libpng flags. Strip hardcoded CFLAGS
>  
> ---- libfsemu/Makefile.orig   Tue Nov 20 00:28:32 2012
> -+++ libfsemu/Makefile        Tue Nov 20 00:28:44 2012
> +--- libfsemu/Makefile.orig   Fri Oct 26 17:28:39 2012
> ++++ libfsemu/Makefile        Tue Dec 18 21:28:36 2012
>  @@ -36,7 +36,7 @@ warnings = -Wall
>   errors = -Werror=implicit-function-declaration
>   cppflags = $(CXXFLAGS)
> @@ -13,3 +13,16 @@ Missing libpng flags
>               $(CFLAGS) -D_FILE_OFFSET_BITS=64
>   objects = obj/emu_emu.o obj/emu_video.o obj/emu_audio.o obj/emu_input.o \
>               obj/emu_menu.o obj/emu_texture.o obj/emu_font.o \
> +@@ -53,12 +53,6 @@ objects = obj/emu_emu.o obj/emu_video.o obj/emu_audio.
> + 
> + ldflags = $(LDFLAGS)
> + libs =
> +-
> +-ifeq ($(debug), 1)
> +-    cflags += -g -O0 -fno-inline
> +-else ifneq ($(noflags), 1)
> +-    cflags += -g -O2
> +-endif
> + 
> + ifeq ($(os), windows)
> + 
> 
> -- 
> Best Regards
> Edd Barrett
> 
> http://www.theunixzoo.co.uk
> 

-- 
Antoine

Reply via email to