Hello, I installed baldur's gate lately and noticed it was still slow in wine, especially if I install a few mods.<div>See the description of the bug here :</div><div><a href="http://bugs.winehq.org/show_bug.cgi?id=17956">http://bugs.winehq.org/show_bug.cgi?id=17956</a></div>
<div><br></div><div>So after reading the page about case insensitive filesystems there <a href="http://wiki.winehq.org/CaseInsensitiveFilenames">http://wiki.winehq.org/CaseInsensitiveFilenames</a></div><div>I decided that one possible solution was to have everything in lower case. So I made a 1st patch (see attachement).</div>
<div>After this, installing a weidu mod in baldur's gate becomes faster, but loading a savegame is still very slow compared to windows.</div><div><br></div><div>After some more investigation using strace, it's because the program uses NtQueryDirectoryFile to check if a file is present in the override directory instead of trying to open it directly, which produces a getdents call in linux, which is extremely unefficient. So I just added a short cut for this function : if the filename argument has no wildcard, then just use stat to return wether the file exists or not. This is in the 2nd patch.</div>
<div>After this, loading savegames was extremely fast, comparable to windows speed, finally, and there are no more slowdowns in game, it runs smoothly all the time !</div><div><br></div><div>Well I am sure you'll find I didn't make them the right way, but I hope the ideas will be useful to you and that you'll merge them in one form or another into wine.</div>
<div>Oh yes, after applying them, all the new files created by wine will be in lower case, but you'll eventually have to convert all the files to lower case in the wine directories (it's required at least in the baldur's gate 2 directory).</div>
<div>Also having a wineprefix with mixed lower and upper case characters would create problems.</div><div>But except that, it works excessively well ! :)</div><div>So maybe you'll want this enabled only if the user explecitely chooses to enable it.</div>
<div>For me I know I'll keep it !</div><div>I attach the simple perl script I used to convert everything to lower case.</div><div><div><br></div>
</div>