PDA

View Full Version : [IMPORTANT] How to significantly reduce stuttering and frame rate drops



Kalandros
12-24-2012, 02:41 PM
Confirmed. I messed with this last night and while there was still some server lag, the game steadied out quite a bit.


How to significantly reduce stuttering and frame rate drops (http://forums.darkfallonline.com/showthread.php?t=345659)

After playing around with process lasso for some time I think I have come up with a pretty good solution for stuttering and frame rate drops. You'll need Process Lasso (http://bitsum.com/prolasso.php)to do this, and in general this is a good program to run on any computer as it helps compensate for windows god awful cpu scheduling. I think a majority of the stuttering comes from CPU thrashing where windows frequently swaps the cpu core that a thread is running on as well as some I/O priority issues.
EDIT: Short Version.
Most of the benefit from this comes from forcing each process to a single core. This can be accomplished with only the task manager by selecting the processes and setting the affinity. If you have a hyperthreaded even numbered cores are true physical cores this includes core 0 and odd numbered cores are hyperthreads. So you would set one process to core 0 or core 0,1 for a hyperthreaded cpu and so on for the rest. My justification for this is that I do not think dfuw makes us of multiple cores very well so the performance gains are negligible. In fact it can have a negative effect because according to intel a majority of memory calls get answered by the L1 cache and each core has its own seperate L1 cache windows has a tendency to haphazardly switch the core a thread is running on when this happens the cpu has to make a call to the ram to fill the L1 cache again which can have 5 to 10 times slower read/write speeds then L1 cache as well as a 40 to 50 times higher latency. This is where hyper threading becomes very useful because it allows 2 threads to execute on 1 core thus sharing the L1 cache and since threads often spend many cpu cycles waiting for I/O operations there is plenty of cpu time left over for hyperthreading to be effective(if you watch the high cpu/ram process with procmon it is responsible for most of the games disk access).
CRITICAL STEP DO NOT SKIP:
With dfuw running find the three processes it spawns in the all processes window of process lasso, right click any one of them and choose "classify as a game or multimedia process" also under the exclude this process sub menu select "exclude from ProBalance restraint".
Next find the dfuw process that has a high cpu usage and a high ram usage I believe this is the process for the actual game engine, right click it and change the I/O priority to high and change the other two processes to low.
EDIT: I/O priority may be useless. On my system they inevitably get set back to normal automatically. Also I/O priority was never really meant to be exposed to the end user and really has no documentation so its use is iffy. Most benefit probably comes from tweaking affinities and setting dfuw to a game/multimedia process.
Last and most importantly you need to isolate each process to its own core. To do this your going to right click them all individually and select the "Set current CPU affinity" sub menu then select "Set CPU affinity". If you have a quad core put each one on its own core I prefer to use cores 2 3 & 4 and change every other running process to core 1. If you have a dual core set the process with a high cpu/ram usage to its own core and then the other two to another core. If you have a hyperthreaded core zero and even numbered cores are real physical cores and odd numbered ones are "logical" cores derived from hyperthreading in this instance you would want to assign each process to a physical/logical core pair like 2,3 for one 4,5 for another 6,7 for the last one. The same idea applies for a dual core hyperthreaded cpu but instead you would put 2 processes on cores 0,1 and the other on 2,3. If you have a single core cpu GTFO and get a real computer.
IMPORTANT
If you have trouble getting the affinities to stick and they keep defaulting back to all cores select the default affinity sub menu and set it to none.
ALTERNATIVE:
If you do choose to allow dfuw access to multiple cores it would probably be best to still isolate the high cpu/low ram process to its own core separate from the other two afaict its primarily responsible for tcp/ip calls so it shouldn't have much effect on fps(this is pure speculation based on watching the processes in procmon). You could then place both the low cpu/ram and the high cpu/ram processes on on 2 cores. So high cpu/low ram on lets say core 6,7 and the other two on cores 2-5 and set the rest of the running processes to 0,1.
EDIT: Some cpus have a turbo boost function that will dynamically adjust the clock multiplier for individual cores and boost performance. On the nehalem architecture(first gen core i7) the first core can be boosted from from a 20x multiplier to a 22x multiplier while all the rest can only go up to 21x. It would stand to reason that many other cpus with a turbo boost would have a similar set up in which case you will want to assign the high cpu/ram process to the first core.
DO NOT! I repeat DO NOT raise the priority class for any of the dfuw processes or for that matter any process this has an almost universally negative effect and anyone who tells you differently doesn't know shit about the windows cpu scheduler.
After doing this myself my framerate is almost as steady as you could ask for. There are still occasional drops that I think are caused by loading data from your hdd/ssd although it may be due to the debugging mode or poorly optimized code because placing dfuw on a ram disk did nothing for it.
As a last note you could accomplish most of this with the task manager but I prefer process lasso because it gives you access to I/O priority as well as allowing you to classify a process as a game or multimedia process thus allowing it to take advantage of the windows multimedia class scheduler.
If you use gamebooster you will want to disable the "boost priority of foreground applications" tweak. It conflicts with what process lasso does.
EDIT: after further research i do not believe that the game/multimedia option gives access to the multimedia class scheduler because it has to be invoked by a process directly, it does however implement a very similar feature to it.

Proximo Coriolanus
12-25-2012, 06:45 AM
Nice