https://bugs.winehq.org/show_bug.cgi?id=46955
Bug ID: 46955 Summary: Performance regression after 3.20 in Assetto Corsa Product: Wine-staging Version: 3.20 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: sambazley@protonmail.com CC: leslie_alistair@hotmail.com, z.figura12@gmail.com Distribution: ---
Created attachment 64083 --> https://bugs.winehq.org/attachment.cgi?id=64083 Wine Staging 3.20 (~25fps)
Since wine-staging v3.20, I get ~25 fps in Assetto Corsa, where as with previous versions, I get ~120 fps.
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #1 from sambazley@protonmail.com --- Created attachment 64084 --> https://bugs.winehq.org/attachment.cgi?id=64084 Wine Staging 3.19 (~120fps)
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #2 from Zebediah Figura z.figura12@gmail.com --- If you have the time and ability, can you please perform a regression test? (See https://wiki.winehq.org/Regression_Testing for instructions).
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #3 from Zebediah Figura z.figura12@gmail.com --- Also, does this performance regression appear in upstream (non-Staging) Wine?
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #4 from sambazley@protonmail.com --- With Wine 4.5 non-staging, I still get ~25 fps. Wine 3.19 non-staging fails to start the game though.
How would I bisect with the staging patches applied?
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #5 from sambazley@protonmail.com --- Created attachment 64091 --> https://bugs.winehq.org/attachment.cgi?id=64091 Wine 4.5 (~25fps)
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #6 from sambazley@protonmail.com --- Tested with the latest non-staging commit (8268c47), get bad performance.
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #7 from sambazley@protonmail.com --- Created attachment 64100 --> https://bugs.winehq.org/attachment.cgi?id=64100 Wine git (~25fps)
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #8 from sambazley@protonmail.com --- d19e34d8f072514cb903bda89767996ba078bae4 is the first affected commit.
https://bugs.winehq.org/show_bug.cgi?id=46955
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |d19e34d8f072514cb903bda8976 | |7996ba078bae4 Component|-unknown |dwrite Keywords| |regression CC| |bunglehead@gmail.com Product|Wine-staging |Wine
https://bugs.winehq.org/show_bug.cgi?id=46955
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|bunglehead@gmail.com |
https://bugs.winehq.org/show_bug.cgi?id=46955
Sam Bazley sambazley@protonmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |performance
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #9 from Sam Bazley sambazley@protonmail.com --- Created attachment 64927 --> https://bugs.winehq.org/attachment.cgi?id=64927 dwrite log with timings
I've measured how long some functions take to run with gettimeofday. dwritetextlayout_Draw often takes 1-5ms, which adds up with each string that is rendered. Here is a list of function calls that originate from dwritetextlayout_Draw, along with the time that it takes for them run in microseconds:
dwritetextlayout_Draw 3028 layout_compute_effective_runs 3012 layout_compute 3006 layout_compute_runs 2995 layout_resolve_fonts 2851 fontfallback_MapCharacters 2593 fallback_map_characters 2561
The file attached is a log with +dwrite while I was looking at the Assetto Corsa setup menu. It includes traces that show the timings for some functions. These start with "===", which is followed by a few numbers. The first number is the total time taken for that function.
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #10 from Nikolay Sivov bunglehead@gmail.com --- Created attachment 66035 --> https://bugs.winehq.org/attachment.cgi?id=66035 patch
Could you test if this patch makes it any better?
https://bugs.winehq.org/show_bug.cgi?id=46955
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #11 from Sam Bazley sambazley@fastmail.com --- (In reply to Nikolay Sivov from comment #10)
Created attachment 66035 [details] patch
Could you test if this patch makes it any better?
Thanks for looking into this. The patch certainly improves performance. In one situation, with the patch applied I get ~70fps, and without the patch I get ~45fps. However, with d19e34d8f0 reverted, I get ~110fps, but this causes the launcher to become unstable.
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #12 from Nikolay Sivov bunglehead@gmail.com --- Thank you, that's helpful. Main issue with this path is that IDWriteFont::HasCharacter() forwards to IDWriteFontFace::HasCharacter(), creating and destroying temporary fontface for every character. I'll need to take care of such decoupling first, which is required for several methods.
Reverting original commit makes all fontfaces cached, which in turn means that every ever accessed font file remains mapped. Depending on number of fonts you got installed, 32-bit application could potentially run out of memory. Is this game 32-bit?
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #13 from Sam Bazley sambazley@fastmail.com --- (In reply to Nikolay Sivov from comment #12)
Reverting original commit makes all fontfaces cached, which in turn means that every ever accessed font file remains mapped. Depending on number of fonts you got installed, 32-bit application could potentially run out of memory. Is this game 32-bit?
Yes, the launcher is 32 bit and the game is 64 bit. That would explain why the launcher crashes, and the game itself does not.
https://bugs.winehq.org/show_bug.cgi?id=46955
maniikarabera@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |maniikarabera@protonmail.ch
https://bugs.winehq.org/show_bug.cgi?id=46955
leillo1975@gmail.com leillo1975@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leillo1975@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=46955
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #66035|0 |1 is obsolete| |
--- Comment #14 from Nikolay Sivov bunglehead@gmail.com --- Created attachment 66340 --> https://bugs.winehq.org/attachment.cgi?id=66340 patch 2
Please try this one with current wine git.
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #15 from Sam Bazley sambazley@fastmail.com --- (In reply to Nikolay Sivov from comment #14)
Created attachment 66340 [details] patch 2
Please try this one with current wine git.
It's definitely better with the patch applied, but it's still not quite as fast as with d19e34d8f0 reverted.
With only the tyre app visible: Unpatched git: 40 fps Patched git: 80 fps d19e34d8f0 reverted: 130 fps
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #16 from Nikolay Sivov bunglehead@gmail.com --- Please try with current wine. HasCharacter() no longer has a penalty of creating temporary face object, so it should be overall faster. If it's still slower than it used to be, new perf/timing report could also help.
https://bugs.winehq.org/show_bug.cgi?id=46955
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #66340|0 |1 is obsolete| |
https://bugs.winehq.org/show_bug.cgi?id=46955
Sam Bazley sambazley@fastmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED
--- Comment #17 from Sam Bazley sambazley@fastmail.com --- Looks like it's fixed! 150 fps where before I would probably get ~30fps. Thank you! :)
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #18 from Nikolay Sivov bunglehead@gmail.com --- Nice. Thanks for testing. If you don't mind sharing, how is your game distributed, is it Steam version, standalone one, or something else? (in case we'll need to retest it at some point later)
https://bugs.winehq.org/show_bug.cgi?id=46955
--- Comment #19 from Sam Bazley sambazley@fastmail.com --- (In reply to Nikolay Sivov from comment #18)
Nice. Thanks for testing. If you don't mind sharing, how is your game distributed, is it Steam version, standalone one, or something else? (in case we'll need to retest it at some point later)
I have two installs of the game. One using steam.exe on wine that I installed a while ago. I wrote how I installed it here https://pastebin.com/tphQUgaT. This is the installation that I used to test for this bug.
I also have it installed using native Steam with Proton. For that to work, you need to run protontricks 244210 dotnet472.
https://bugs.winehq.org/show_bug.cgi?id=46955
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |745452ee948380261ce992ad681 | |fc1dc6c16df2d
https://bugs.winehq.org/show_bug.cgi?id=46955
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #20 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.11.
https://bugs.winehq.org/show_bug.cgi?id=46955
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Performance regression |Text rendering performance |after 3.20 in Assetto Corsa |regression in Assetto Corsa