http://bugs.winehq.org/show_bug.cgi?id=30148
Bug #: 30148 Summary: Star Wars: The Old Republic - slow loading times Product: Wine Version: unspecified Platform: x86-64 OS/Version: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: julusp@gmail.com Classification: Unclassified
Created attachment 39322 --> http://bugs.winehq.org/attachment.cgi?id=39322 Wine debug log
The game takes too much to load depending on location. For example Nar Shaadaa takes about 15 minutes to load, which in meanwhile, often leads to logoff. I have attached the basic debug log.
To overcome the login issue, patch from Bug 29618 is needed
http://bugs.winehq.org/show_bug.cgi?id=30148
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor
--- Comment #1 from Dmitry Timoshkov dmitry@baikal.ru 2012-03-12 07:53:02 CDT --- Please specify Wine version you are using in the Version field above.
http://bugs.winehq.org/show_bug.cgi?id=30148
julusp@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |1.4
http://bugs.winehq.org/show_bug.cgi?id=30148
Vitaliy Margolen vitaliy-bugzilla@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29618
--- Comment #2 from Vitaliy Margolen vitaliy-bugzilla@kievinfo.com 2012-03-12 07:57:41 CDT --- Does this slowdown happens on Mac only or Linux too?
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #3 from julusp@gmail.com 2012-03-12 08:03:52 CDT --- The patch is needed from Bug 29168 . I made a typo in the initial comment
http://bugs.winehq.org/show_bug.cgi?id=30148
dlzerocool dl.zerocool@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dl.zerocool@gmail.com
--- Comment #4 from dlzerocool dl.zerocool@gmail.com 2012-03-12 08:06:51 CDT --- @Vitaliy Margolen : It does happen in Linux too. What is strange is that there is no activity at all and suddenly it starts to load.
Even the log-in process seems much slower than what you can see on a win7 os.
http://bugs.winehq.org/show_bug.cgi?id=30148
Vitaliy Margolen vitaliy-bugzilla@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on|29618 |29168
--- Comment #5 from Vitaliy Margolen vitaliy-bugzilla@kievinfo.com 2012-03-12 08:23:26 CDT --- Then someone on Linux can use oprofile to narrow down the issue. The other bug indicates that some processes taking %100 CPU. This could for a number of reasons, especially that protection systems involved.
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #6 from julusp@gmail.com 2012-03-12 09:46:10 CDT --- Created attachment 39324 --> http://bugs.winehq.org/attachment.cgi?id=39324 profile sample from wine swtor.exe
Meanwhile, while waiting for oprofile from linux, i have attached the 10seconds sample profile taken from wine swtor.exe process while staying in login screen on osx. Maybe not quite as explenatory as oprofile, but you may find some things there. Sample taken via BSD sample command.
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #7 from julusp@gmail.com 2012-03-12 09:47:07 CDT --- (In reply to comment #6)
Created attachment 39324 [details] profile sample from wine swtor.exe
Meanwhile, while waiting for oprofile from linux, i have attached the 10seconds sample profile taken from wine swtor.exe process while staying in login screen on osx. Maybe not quite as explenatory as oprofile, but you may find some things there. Sample taken via BSD sample command.
I mean Loading screen.. damn... need to reread thing before posting...
http://bugs.winehq.org/show_bug.cgi?id=30148
Samuel Silbory sam.flory@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sam.flory@gmail.com
--- Comment #8 from Samuel Silbory sam.flory@gmail.com 2012-03-12 22:38:41 CDT --- How does one profile wine? I know how to run oprofile but I'm not what process to profile. Wineserver?
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #9 from julusp@gmail.com 2012-03-12 23:10:52 CDT --- I made some research. Some windows users are reporting long loading times too, but not this long (max 4-5 minutes), normal speed is up to 1 minute. Also the game load data from /assets/*.tor files into /swtor/DiskArenaCache file. It perform it so often, that putting DiskArenaCache to ramdisk on Windows leads to better loading times. But this is not the case on Linux/OSX (at least nothing noticable). IMHO it seems that wine has some problem with efficient reading of this *.tor files (some kind of archive) or problem with writing to DiskArenaCache.
Also, as this game is online mmorpg, it does not contain any kind of DRM protection, and it seems it does not have cheating protection either.
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #10 from dlzerocool dl.zerocool@gmail.com 2012-03-13 08:39:24 CDT --- (In reply to comment #9)
I made some research. Some windows users are reporting long loading times too, but not this long (max 4-5 minutes), normal speed is up to 1 minute. Also the game load data from /assets/*.tor files into /swtor/DiskArenaCache file. It perform it so often, that putting DiskArenaCache to ramdisk on Windows leads to better loading times. But this is not the case on Linux/OSX (at least nothing noticable). IMHO it seems that wine has some problem with efficient reading of this *.tor files (some kind of archive) or problem with writing to DiskArenaCache.
Also, as this game is online mmorpg, it does not contain any kind of DRM protection, and it seems it does not have cheating protection either.
The problem that I could see is that it writes a lot to disk, and when I tell you a lot it is a LOT. I have a SSD and had just the time to do an analyse on write and reads when the game starts, the game totally saturate read and write on my SSD and that for 3 to 5 minutes.
I don't have Windows so I can't argue if it would be the same on Windows, but I highly doubt it. Or the game has a huge resources problem.
I can't do much more tests, I am very busy at the moment. I'll keep an eye on both bugs concerning this game tough, and post results when I can.
http://bugs.winehq.org/show_bug.cgi?id=30148
mbokman@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mbokman@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #11 from julusp@gmail.com 2012-03-17 17:04:22 CDT --- (In reply to comment #10)
The problem that I could see is that it writes a lot to disk, and when I tell you a lot it is a LOT. I have a SSD and had just the time to do an analyse on write and reads when the game starts, the game totally saturate read and write on my SSD and that for 3 to 5 minutes.
I don't have Windows so I can't argue if it would be the same on Windows, but I highly doubt it. Or the game has a huge resources problem.
I can't do much more tests, I am very busy at the moment. I'll keep an eye on both bugs concerning this game tough, and post results when I can.
Little more investigation done. The load stops for only big locations, small locations load fine almost without hickup. During the stop, there is almost no network activity, minor disk activity (monitored via iostat), but heavy cpu usage by wine. All game files are stored in Assets directory in *tor files which are MYP archive. Seems the wine has problem wih reading and extracting files from the large archive (Nar shaada has 300MB + 100MB archive).
http://bugs.winehq.org/show_bug.cgi?id=30148
Marco D moonbane@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |moonbane@gmx.net
--- Comment #12 from Marco D moonbane@gmx.net 2012-03-17 17:46:09 CDT --- Its really weird.
I cannot confirm any longer loading delays than under windows. Just do not see any difference while playing.
The only real issue is, that it takes around 20 mins to start up (play in the launcher to login screen)
Will try an oprofile later today/tomorrow.
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #13 from julusp@gmail.com 2012-03-17 18:11:03 CDT --- I found another interesting thing. When loading (wierd thing in corner is spinning), wine is consuming 100% - user time, when the load hangs, wine is still consuming 100% but SYS time (quite possible the __read (in libsystem_kernel.dylib) as can be seen in profile sample). After some time, it goes to user time for a moment, then again the sys time and so on. This is happening until it eventually loads.
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #14 from julusp@gmail.com 2012-03-20 11:37:24 CDT --- I found a brief documentation how HeroEngine use the data storage, Unfortunetly, I dont know which method is swtor using, but maybe still worth of looking.
http://hewiki.heroengine.com/wiki/Data_storage_options
http://bugs.winehq.org/show_bug.cgi?id=30148
Erik Weatherwax erik.weatherwax@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |erik.weatherwax@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=30148
julusp@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #39324|0 |1 is obsolete| |
--- Comment #15 from julusp@gmail.com 2012-03-28 19:29:28 CDT --- Created attachment 39587 --> http://bugs.winehq.org/attachment.cgi?id=39587 Sample of swtor
Attaching sample of swtor during loading in csv format, where you can clearly see what is running for most cpu time...
This sample is almost 90 seconds long. seems like issue with MapViewOfFile
http://bugs.winehq.org/show_bug.cgi?id=30148
Ian ian@ianlevesque.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ian@ianlevesque.org
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #16 from julusp@gmail.com 2012-04-01 21:37:57 CDT --- Issue remains in Wine 1.5.1. Looking on appdb, this issue is mostly osx specific.
Also when tracing i found that this:
trace:ntdll:NtSetIoCompletion (0xfc, 3, 6650f40, 0, 0) trace:ntdll:NtRemoveIoCompletion (0xfc, 0xa6ff578, 0xa6ff580, 0xa6ff500, 0xa6ff4f8) trace:ntdll:NtSetIoCompletion (0xfc, 1, 0, 0, 0) trace:ntdll:NtSetIoCompletion (0xfc, 2, 0, 0, 0) trace:ntdll:NtRemoveIoCompletion (0xfc, 0xa6ff578, 0xa6ff580, 0xa6ff500, 0xa6ff4f8) trace:ntdll:NtRemoveIoCompletion (0xfc, 0xa6ff578, 0xa6ff580, 0xa6ff500, 0xa6ff4f8) trace:ntdll:NtRemoveIoCompletion (0xfc, 0xa6ff578, 0xa6ff580, 0xa6ff500, 0xa6ff4f8) trace:ntdll:NtRemoveIoCompletion (0xfc, 0xa6ff578, 0xa6ff580, 0xa6ff500, 0xa6ff4f8) trace:ntdll:NtRemoveIoCompletion (0xfc, 0xa6ff578, 0xa6ff580, 0xa6ff500, 0xa6ff4f8)
this is repating over and over when loading, but I dont know if this is ok or not...
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #17 from julusp@gmail.com 2012-04-06 19:34:00 CDT --- Heaviest usage (map_file_into_view):
In source code: dlls/ntdll/virtual.c:885: if (mmap( (char *)view->base + start, size, prot, flags, fd, offset ) != (void *)-1)
In (de)assembly: +0x1cf calll DYLD-STUB$$mmap$UNIX2003
I even tryied rejected patch from 2010 by Charles Davis which uses old mmap instead of mmap$UNIX2003 but no speed change.
also map_file_into_view and wine_annon_mmap calls are the slowest ones (25-150ms) (mmap call)
Is there any way of disabling mmap usage in wine or some kind of workaround around this issue?
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #18 from Alexandre Julliard julliard@winehq.org 2012-04-07 03:49:49 CDT --- mmap is very slow on Mac OS, there's nothing we can do about that.
http://bugs.winehq.org/show_bug.cgi?id=30148
doh123@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |doh123@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #19 from julusp@gmail.com 2012-04-07 22:12:22 CDT --- (In reply to comment #18)
mmap is very slow on Mac OS, there's nothing we can do about that.
I made some test myself (mmap/munmap) and the MAP_PRIVATE flag makes really slow: MAP_PRIVATE 1000 mmaps (real/user/sys): 20.717s/0.008s/20.671s MAP_SHARED 1000 mmaps (real/user/sys): 0.010s/0.001s/0.008s
same script on linux MAP_PRIVATE 1000 mmaps (real/user/sys): 0.008s/0.000s/0.008s
according to vmmap command, game uses MAP_PRIVATE.
also I found old communication about git, describing the same problem on osx. Linus suggested to use pread() instead, and the result was: from (estimated) 37 minutes using mmaps to 52 seconds using pread(). source: http://www.spinics.net/lists/git/msg18258.html
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #20 from julusp@gmail.com 2012-04-08 17:57:21 CDT --- I made better benchmark (which actually read the mmaped file) so the results more believable:
MAP_PRIVATE OSX LINUX 1000 mmaps 4KB blocks: 22483ms 20ms 1000 mmaps 64KB blocks: 22381ms 264ms 1000 mmaps 1024KB blocks: 24862ms 4227ms
MAP_SHARED OSX LINUX 1000 mmaps 4KB blocks: 18ms 19ms 1000 mmaps 64KB blocks: 170ms 268ms 1000 mmaps 1024KB blocks: 2730ms 4302ms
And I submitted bug to Apple. We'll see if they will fix or come up with another solution.
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #21 from jonas.aschenbrenner@gmail.com 2012-11-10 13:20:20 CST --- Created attachment 42474 --> http://bugs.winehq.org/attachment.cgi?id=42474 Fix for slow private memory maps by using anonymous mapping with pread instead.
I've created a patch for the game "The War-Z" that has a similar problem. I think the chances are good that the patch will fix the problem also for SWTOR.
http://bugs.winehq.org/show_bug.cgi?id=30148
gregor gregor.binder@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gregor.binder@gmx.net
https://bugs.winehq.org/show_bug.cgi?id=30148
Jarkko K jarkko_korpi@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jarkko_korpi@hotmail.com
--- Comment #22 from Jarkko K jarkko_korpi@hotmail.com --- Interesting issue. Is this still valid and did apple reply somehow or did that patch got merged?
https://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #23 from Ken Thomases ken@codeweavers.com --- There have been several recent commits in this area:
http://source.winehq.org/git/wine.git/?a=commit;h=4792cf31c5dac3f5216bff8f4f... http://source.winehq.org/git/wine.git/?a=commit;h=5ceb22714e965692acf2b0ec9a... http://source.winehq.org/git/wine.git/?a=commit;h=2cef8dbcc29739278037e6409e...
Please retest with current git.
http://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #24 from julusp@gmail.com --- Thanks Ken for pointing them out.
Unfortunately I am not able to test it currently against SWTOR, however, I have tested it against Path Of Exile which suffers from same issue (well a lot of games does). There is still no improvement and from 40s sample, the 30s are spend in NTMapViewOfSection call (and from there 14s map_file_into_view > 14s __mmap and 13s map_view> 12s wine_anon_mmap > 12s __mmap)
Seems like it is still hitting some OSX specific barrier, which cannot be so simply avoided... Even copying whole game to ramdisk and running from there does not speed up anything (results are pretty much the same)
https://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #25 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for over a year. Is this still an issue in current (1.7.51 or newer) wine?
https://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #26 from julusp@gmail.com --- As this is not entirely wine issue, but rather how (badly) the OSX handles the memory allocations when mapping is private, I don't believe this can be easily solved in wine code.
As this is not the wine bug, please close it as upstream/notourbug.
Note: I've already open a bug report with a reproducer code to apple couple years ago, clearly demonstrating this issue, which has been closed as duplicate.
https://bugs.winehq.org/show_bug.cgi?id=30148
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |UPSTREAM
--- Comment #27 from Austin English austinenglish@gmail.com --- (In reply to julusp from comment #26)
As this is not entirely wine issue, but rather how (badly) the OSX handles the memory allocations when mapping is private, I don't believe this can be easily solved in wine code.
As this is not the wine bug, please close it as upstream/notourbug.
Note: I've already open a bug report with a reproducer code to apple couple years ago, clearly demonstrating this issue, which has been closed as duplicate.
Is there a public URL for that?
https://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #28 from julusp@gmail.com --- (In reply to Austin English from comment #27)
Is there a public URL for that?
No, Apple bug reported can be accessed only with dev account and even then you are able to see only your bugs.
https://bugs.winehq.org/show_bug.cgi?id=30148
gregor gregor_forum@catrix.at changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gregor_forum@catrix.at
--- Comment #29 from gregor gregor_forum@catrix.at --- I face the same problem, the loading time took about 20 minutes (or longer).
Environment: ------------ OS: Arch Linux Kernel: 4.2.5-1-ARCH Wine: wine-1.8-rc4 CPU: Intel(R) Core(TM)2 Quad CPU Q9650 @ 3.00GHz Ram: 8GB
https://bugs.winehq.org/show_bug.cgi?id=30148
--- Comment #30 from gregor gregor_forum@catrix.at --- (In reply to gregor from comment #29)
I face the same problem, the loading time took about 20 minutes (or longer).
Environment:
OS: Arch Linux Kernel: 4.2.5-1-ARCH Wine: wine-1.8-rc4 CPU: Intel(R) Core(TM)2 Quad CPU Q9650 @ 3.00GHz Ram: 8GB
UPDATE: With the swtor_fix.exe I can use the game
https://bugs.winehq.org/show_bug.cgi?id=30148
jeremyofmany jeremy.of.many2@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremy.of.many2@gmail.com
--- Comment #31 from jeremyofmany jeremy.of.many2@gmail.com --- I'm not sure if my issue is related/similar to this. I have posted all about it here and provided logs and screen shots: https://forum.winehq.org/viewtopic.php?f=8&t=27318&p=107322#p107322 Basically, even when using swtor_fix.exe, and Wine 1.9.19-staging, the launcher runs fine, I put in my password, Enter and then click Play.
From that point it takes 16-17 minutes before the splash screen appears and
then finally the character selection screen. See more details in my post.
https://bugs.winehq.org/show_bug.cgi?id=30148
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #32 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=30148
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |RESOLVED
--- Comment #33 from Austin English austinenglish@gmail.com --- This was inadvertently caught up in my unclosed bugs filter. NOTOURBUG should only be closed when fixed upstream.
Setting back to RESOLVED NOTOURBUG.
Sorry for the spam.
https://bugs.winehq.org/show_bug.cgi?id=30148 Bug 30148 depends on bug 29168, which changed state.
Bug 29168 Summary: Multiple games and applications need realtime updates to KSYSTEM_TIME members in KUSER_SHARED_DATA (Star Wars: The Old Republic game client, Blizzard games, GO 1.4+ runtime, Denuvo Anti-Tamper x64 #2) https://bugs.winehq.org/show_bug.cgi?id=29168
What |Removed |Added ---------------------------------------------------------------------------- Status|STAGED |RESOLVED Resolution|--- |FIXED