Page 1 of 1

[0.11.1] Performance on windows 32 bit vs 64 bit

Posted: Sat Nov 08, 2014 1:56 am
by Boogieman14
I'm noticing some weird performance differences between 32 and 64 bit Factorio on my Windows 7 system. I wasn't sure if I should report this at all, but since I've seen some reports about frequent desyncs in MP when 32 and 64 bit clients are mixed, I figured it might just help someone with more in-depth knowledge of this matter to figure out what's happening.

The problem I'm experiencing is that with a decent number of mods loaded (most of DyTech and a few utility mods), I get frequent stutters in performance on 64-bit Factorio. This frequency is roughly once every 3 seconds and the stutter is noticable enough to be annoying. At first I figured it might be related to a specific mod or combination of mods (see https://forums.factorio.com/forum/vie ... =25&t=6550 for the thought process there), but I'm now reasonably confident that isn't the case. I have noticed the problem does not occur at all in the 32-bit version, otherwise using the exact same configuration and mods (I downloaded both as a zip, extracted to the same directory and copied the mods in).

I did some more digging and using Sysinternals Process Explorer, I noticed that the 64-bit version has a very high page fault delta peak of 180,000 roughly every 3 seconds, coinciding with the stutter. With 32-bit Factorio, the page fault delta is fairly consistently below 10, with an occasional peak in the 100s. Now, page faults are a normal occurence, but it's the difference that worries me.

To make matters more confusing, I also tried this same test on a laptop running Win7 64-bit. I was unable to reproduce it there, so that indicates it's either a fault somewhere in my hardware (possible, but unlikely as not a single other application gives me any trouble) or some specific combination of hardware, drivers and/or settings. Even though I'm unable to reproduce it, I'm still reporting it because of the earlier mentioned MP desyncs. It's my understanding that page faults are a fairly low-level operating system thing that the application may (should?) not be aware of. I have no doubt there's some leeway in this, but when there's peaks of this magnitude, I think it's conceivable that this may influence some calculations, in turn causing a desync.

I hope someone with some more knowledge of this stuff will be able to make heads and tails of my ramblings :)

I'd be happy to provide any more information if required.

For reference, the system I'm having this problem on is a Core i5 CPU, 16GB RAM, AMD Radeon 6870 GPU and an SSD that holds both OS and Factorio. My laptop is a Core i7, 8GB RAM, Nvidia GPU (I couldn't easily find the model right now, but it's probably something in the 400 mobile range) and also an SSD for OS + Factorio.

Re: [0.11.1] Performance on windows 32 bit vs 64 bit

Posted: Sat Nov 08, 2014 5:23 am
by SuperSandro2000
Have you used they same settings?

Re: [0.11.1] Performance on windows 32 bit vs 64 bit

Posted: Sat Nov 08, 2014 11:46 am
by Nathan1852
I'm having the same problem, no idea what might be causing it

Re: [0.11.1] Performance on windows 32 bit vs 64 bit

Posted: Sat Nov 08, 2014 12:31 pm
by Boogieman14
SuperSandro2000 wrote:Have you used they same settings?
Yes, I downloaded the zip version for both 32- and 64-bit and extracted them to the same directory. Everything but the exe is shared.

Re: [0.11.1] Performance on windows 32 bit vs 64 bit

Posted: Sat Nov 08, 2014 9:26 pm
by Nathan1852
It would be nice if we get a fix for this soon, as this makes playing the game pretty annoying

I've made some screenshots of the tool Boogieman14 used.
There is nothing in the log files or in the debug stats shown ingame that seems to be affected by this
The normal stats without lag
The normal stats without lag
ss (2014-11-09 at 12.28.45).png (45.06 KiB) Viewed 4979 times
When a lag is happening
When a lag is happening
ss (2014-11-09 at 12.29.12).png (48.72 KiB) Viewed 4979 times

Re: [0.11.1] Performance on windows 32 bit vs 64 bit

Posted: Sun Nov 09, 2014 11:57 am
by MF-
I thought that's the general disadvantage of 64bit code.
It needs twice the space for both memory addresses and data values,
so it might happen that the 32bit version fits into the cache, while the 64bit one doesn't.
also it might happen that the 32bit version fits into RAM, while 64bit has to be partially swapped out

Re: [0.11.1] Performance on windows 32 bit vs 64 bit

Posted: Tue Nov 11, 2014 8:19 pm
by Lee_newsum
Core i5 CPU, 2 to 4 Cores 2.67 GHz to 3.6 GHz : ok
16GB RAM, :More than you ned
AMD Radeon 6870 GPU (1 GB VRAM) 42nd on steampowered.com hwsurvey, Overall Rank: 89 on http://www.videocardbenchmark.net/gpu.p ... on+HD+6870 : for the bash game it is ok at min system requirement to play with DyTech add a lot 2x and all the over mods add more.
SSD that holds both OS and Factorio
SSD / Solid State Drives SATA 6 Gb/s or PCIe 2.0 x 8 SATA all ok
PCIe 2.0 x 8 on low/cheap Motherboards the data bus can shares, so the GPU and SSD has 1/2 bandwidth this can not help if you max out your GPU.
MF- wrote:I thought that's the general disadvantage of 64bit code.
It needs twice the space for both memory addresses and data values,
so it might happen that the 32bit version fits into the cache, while the 64bit one doesn't.
also it might happen that the 32bit version fits into RAM, while 64bit has to be partially swapped out
nop a 64bit system has hardware is 64bit( mostly) software is 64bit. a 64bit can run 32bit software, but the same app can run 2x in 64bit than a 32bit

Re: [0.11.1] Performance on windows 32 bit vs 64 bit

Posted: Mon Jan 26, 2015 9:27 pm
by rorror
Nathan1852 wrote:It would be nice if we get a fix for this soon, as this makes playing the game pretty annoying

I've made some screenshots of the tool Boogieman14 used.
There is nothing in the log files or in the debug stats shown ingame that seems to be affected by this
your normal page file looks way to bay. you got 1.800.000,000 i got only 7.000.00 after a few hours on a huge map and base.

can you make a printscreen when running the game and show your overal memory usage details?

Re: [0.11.1] Performance on windows 32 bit vs 64 bit

Posted: Tue Jan 27, 2015 12:06 pm
by kovarex
One of the thing I made for the next version is, that the lua garbage collector isn't started once per 5 seconds for a complete run, but instead it runs incrementally every tick, I believe it could have to do something with the issue.

Mainly because the memory taken by 64bit lua might be much higher.