• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › General Discussion v
« Previous 1 ... 141 142 143 144 145 ... 369 Next »

Hyrule Field Slowdown Observation
View New Posts | View Today's Posts

Pages (74): « Previous 1 ... 10 11 12 13 14 ... 74 Next »
Jump to page 
Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Hyrule Field Slowdown Observation
03-30-2010, 11:08 AM
#111
Xtreme2damax Offline
New & Improved
********
Global Moderators
Posts: 3,135
Threads: 91
Joined: Mar 2009
Well I was browsing through some coding help sites that I found by searching _mm_pause and reading through Msdn..

Sigh, I wish I knew how to code.. I really do want to help to the best of my abilities.

But I solved the compilation errors, here's the actual code (Did require edits to other source files to change YieldCPU to YieldProcessor:

Quote:inline void YieldProcessor()
{
#ifdef _WIN32
Sleep(0);
#elif defined(_M_IX86) || defined(_M_X64)
thr_yield();
#else
sched_yield();
#endif
}

The code above may still need a minor edit. According to MSDN and other coding site, shouldn't YieldCPU(); or YieldProcessor(); be void YieldCPU(void); or void YieldProcessor(void); instead?
Find
Reply
03-30-2010, 11:10 AM (This post was last modified: 03-30-2010, 11:11 AM by James333.)
#112
James333 Offline
Above and Beyond
*******
Posts: 1,520
Threads: 8
Joined: Jul 2009
Send me the patch to take a look at it ( Actually I don't know how to code either , but my logic says 0+0=1 Tongue )
MB : MSI Z68A-GD80
CPU : Intel Core i7 2600k @ 3.4 GHz (stock clock)
Gfx : ATI Raedon HD 6850
Ram : 4 GB DDR3-1333
OS : Windows XP x86

I speak Spanish Big Grin ( And a little English )
Find
Reply
03-30-2010, 11:21 AM
#113
Xtreme2damax Offline
New & Improved
********
Global Moderators
Posts: 3,135
Threads: 91
Joined: Mar 2009
(03-30-2010, 11:10 AM)James333 Wrote: Send me the patch to take a look at it ( Actually I don't know how to code either , but my logic says 0+0=1 Tongue )

Well it doesn't seem to have any effects on the slowdowns, at least for Twilight Princess it doesn't. I've gone through and tried everything I can think of, perhaps someone else might have a better idea.

So far the code I edited doesn't seem to affect stability or performance, not exactly sure why.


.zip   YieldProcesser Patch.zip (Size: 1.14 KB / Downloads: 80)
Find
Reply
03-30-2010, 11:28 AM (This post was last modified: 03-30-2010, 11:29 AM by James333.)
#114
James333 Offline
Above and Beyond
*******
Posts: 1,520
Threads: 8
Joined: Jul 2009
Code:
inline void YieldProcessor() // How this doesn't cause conflicts with the YieldProcessor() function that was in the ifdef before ?
{
#ifdef _WIN32
Sleep(0); // <--Where did this functions came from ? They were present in one of the included files or something like that ?
#elif defined(_M_IX86) || defined(_M_X64)
thr_yield();  // <--Where did this functions came from ? They were present in one of the included files or something like that ?
#else
sched_yield();  // <--Where did this functions came from ? They were present in one of the included files or something like that ?
#endif
}

Besides that you just changed the names
MB : MSI Z68A-GD80
CPU : Intel Core i7 2600k @ 3.4 GHz (stock clock)
Gfx : ATI Raedon HD 6850
Ram : 4 GB DDR3-1333
OS : Windows XP x86

I speak Spanish Big Grin ( And a little English )
Find
Reply
03-30-2010, 12:11 PM
#115
Xtreme2damax Offline
New & Improved
********
Global Moderators
Posts: 3,135
Threads: 91
Joined: Mar 2009
Well the functions obviously had to be included in of the other files else I would of got errors when compiling, seems those functions were already present.
Find
Reply
03-31-2010, 02:48 AM
#116
Jack Frost Offline
aka. BhaaL
**********
Developers (Some Administrators and Super Moderators)
Posts: 511
Threads: 3
Joined: Oct 2009
sched_yield is defined in sched.h and should be available on all POSIX compliant systems.
thr_yield is defined in thread.h and seems to be only available on Solaris.
Sleep is defined in windows.h and Windows-only.

Sleep(0) apparently does what other devs intended with YieldCPU, but only on Win32. usleep/nanosleep on *nix dont seem to do this; sched_yield is probably the better idea there.
Try this:
Code:
inline void YieldProcessor()
{
#ifdef _Win32
    Sleep(0);
#else
    sched_yield();
#endif
}
with
Code:
#ifdef _WIN32
#include <windows.h>
#else
#include <sched.h>
#endif
on top of the file, unless those two are already included by chance.
Find
Reply
03-31-2010, 03:26 AM (This post was last modified: 03-31-2010, 03:54 AM by Xtreme2damax.)
#117
Xtreme2damax Offline
New & Improved
********
Global Moderators
Posts: 3,135
Threads: 91
Joined: Mar 2009
Quote:Sleep(0) apparently does what other devs intended with YieldCPU, but only on Win32

What would it be for Win64 (x86_64) based operating systems such as XP/Vista/W7 x64?

Btw, why do some of the definitions become grayed out in VS2008?

Quote:inline void YieldProcessor()
{
#ifdef _Win32
Sleep(0);
#else
sched_yield();
#endif
}

That code gives me the following errors:

Code:
Error    1    error C3861: 'sched_yield': identifier not found    d:\my documents\emulator svn\dolphin-clean\source\core\common\src\Thread.h    219
Find
Reply
03-31-2010, 05:44 AM (This post was last modified: 03-31-2010, 05:48 AM by Xtreme2damax.)
#118
Xtreme2damax Offline
New & Improved
********
Global Moderators
Posts: 3,135
Threads: 91
Joined: Mar 2009
If anyone would like try these patches, be sure to report any changes in performance or any issues these patches may cause. Please test with other games besides Zelda: Twilight Princess, by testing other games in addition to Twilight Princess we should be able to see if this has any effect on performance at all for other games since it doesn't seem to affect ZTP all that much if at all.

I've only tested only of the patches and it doesn't seem to affect the slowdowns in Hyrule Field, however it may improve performance for other games. I tried Resident Evil 4 and another game and seemed to get better performance than before the patch.


.zip   Yield Processor Patch Test 1.zip (Size: 1.23 KB / Downloads: 83)


.patch   Yield Processor Patch Test 2.patch (Size: 4.11 KB / Downloads: 98)

Similar to thread.h of r3845, with a minor modification that shouldn't make a difference:


.patch   YieldProcessor Patch Test 3.patch (Size: 3.62 KB / Downloads: 84)
Find
Reply
03-31-2010, 05:47 AM (This post was last modified: 03-31-2010, 06:02 AM by James333.)
#119
James333 Offline
Above and Beyond
*******
Posts: 1,520
Threads: 8
Joined: Jul 2009
Try
Code:
{
#ifdef _WIN32 // interesting _WIN32 works but _Win32 doesn't :)
Sleep(0);
#else
sched_yield();
#endif
}

Your same patches but with the caps corrected Tongue


.patch   Yield Processor Patch Test 1.patch (Size: 4.14 KB / Downloads: 80)
.patch   Yield Processor Patch Test 2.patch (Size: 4.17 KB / Downloads: 75)
.patch   YieldProcessor Patch Test 3.patch (Size: 3.68 KB / Downloads: 101)
MB : MSI Z68A-GD80
CPU : Intel Core i7 2600k @ 3.4 GHz (stock clock)
Gfx : ATI Raedon HD 6850
Ram : 4 GB DDR3-1333
OS : Windows XP x86

I speak Spanish Big Grin ( And a little English )
Find
Reply
03-31-2010, 07:47 AM
#120
Xtreme2damax Offline
New & Improved
********
Global Moderators
Posts: 3,135
Threads: 91
Joined: Mar 2009
A quick question, why do I only see definitions for _WIN32 and not _WIN64 as well? Wouldn't it make sense to also have definitions for _WIN64 for the 64-bit build of Dolphin?
Find
Reply
« Next Oldest | Next Newest »
Pages (74): « Previous 1 ... 10 11 12 13 14 ... 74 Next »
Jump to page 


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode