How to compile Wine for best performance?

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
omashow
Newbie
Newbie
Posts: 1
Joined: Tue Feb 07, 2017 10:42 pm

How to compile Wine for best performance?

Post by omashow »

Hi, I've read that compiling Wine yourself can give better performance than using the packaged binary. I've tried compiling Wine, but I'm not really seeing any improvement in performance of Wine on my PC. Is there any configuration or options I can pass to the compiler to get Wine optimized for my hardware?

FYI, I'm using Kubuntu 11.10 running on a PC with an AMD A6-3500 triple-core CPU.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: How to compile Wine for best performance?

Post by Bob Wya »

omashow wrote:Hi, I've read that compiling Wine yourself can give better performance than using the packaged binary. I've tried compiling Wine, but I'm not really seeing any improvement in performance of Wine on my PC. Is there any configuration or options I can pass to the compiler to get Wine optimized for my hardware?

FYI, I'm using Kubuntu 11.10 running on a PC with an AMD A6-3500 triple-core CPU.
There's probably not much greater performance to get out of Wine. Multilib 64-bit binary packages will already have most of the basic 64-bit CPU optimisations enabled already.

I use Gentoo as a daily driver distribution - so that means compiling everything (apart from the odd binary package). There's a well known Gentoo blog post about optimising your packages... or not!!

I've messed about a little with loop-unrolling/graphite and LTO (link time optimisation) - they still tend to lead to some build failures and much greater buildtimes. That sort of thing really won't help with Wine - it's more likely just to break something - because Wine uses a pre-loader to load native Windows PE executables and dynamic link libraries into the Linux Virtual Memory space. Wine is written in to-the-metal C - so there isn't much better performance to eek out - without re-implementing the actual code in a totally different form.
Using native build flags (i.e. optimisations for your particular CPU archiecture) will make only a very marginal difference. For example the AVX instructions and other vectorisation stuff in newer Intel CPUs isn't used by Wine. You have a 3-core pre-Ryzen AMD CPU anyway...
Image

If you're a gamer, then Wine Staging or Wine Staging with Gallium Direct3D (for AMD GPU's), might be a good option.

Disabling console debugging will help a bit for any application:

Code: Select all

export WINEDEBUG=-all
Stephan wrote up some performance tuning tips in the WineHQ Wiki - see WineHQ: Performance ...
Since he used to work on the DirectX subsystem - that is the main focus of this article.

You can do other things like boot straight into an minimal X-session to run applications (Wine or native). This would typically done to run a piece of software like Steam.

Ubuntu-based distros are known to be a bit bloated up with background services...
An Arch-based distro - like Antergos or KDE Neon (Plasma 5 re-spin of the Ubuntu core) - might offer better performance vs. Kubuntu.
I certainly wouldn't run such an old and unsupported Linux distro - unless you like to offer pentetration testers the opportunity to exploit your system... :cry:
Sure that Kubuntu version number is right?

Bob
User avatar
dimesio
Moderator
Moderator
Posts: 13204
Joined: Tue Mar 25, 2008 10:30 pm

Re: How to compile Wine for best performance?

Post by dimesio »

Bob Wya wrote: Sure that Kubuntu version number is right?
It's not. What we have here is a spammer trying to get past the moderation period by copying old posts. viewtopic.php?f=2&t=14452

I've banned the poster.
Nystagmus
Level 2
Level 2
Posts: 10
Joined: Mon Dec 21, 2015 10:28 pm

Re: How to compile Wine for best performance?

Post by Nystagmus »

Another performance tip is to disable file last access logging within the filesystem in /etc/fstab. It's called "noatime" (no access time logging).
You can find instructions on how to do that at https://UbuntuForums.com

It's not needed for most programs because creation times and modification times are logged separately.
Just knowing that a file was read isn't really essential info data and causes a lot of extra unneeded activity.

You'll find some other performance tips if you search for "DAW tweaks Linux" or "DAW optimizations Linux".
DAW = Digital Audio Workstation
Some of the optimizations that apply for gaming also apply to digital audio work or sometimes video work, and vice versa.
Good luck.
Locked