- Home /
Unity is performing 2x better on weaker macbook than on beast PC -- what should I look for as the reason for this?
I have a project that is very CPU-intensive as it involves a large number of cellular automata. It has always run smoothly on my old PC and my current macbook pro. My old PC bit the dust, and now my newer, more powerful PC seems to have trouble with this project. The macbook with weaker specs runs it much better.
The difference in performance is severe. Using the profiler, the same scripts in the same project in the same version of unity take 1/3 the ms on my mac as on my pc. Below are the specs for both systems.
PC specs:
Operating System: Windows 7 Professional 64-bit (6.1, Build 7601) Service Pack 1
Processor: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz (12 CPUs), ~3.3GHz
Memory: 32768MB RAM
Available OS Memory: 32668MB RAM
Video Card: NVIDIA GeForce GTX 980 Ti
Macbook specs:
Processor: 2.9GHz Intel Core i7
Memory: 8 GB 1600 MHz DDR3
Graphics: Intel HD 4000 1536 MB
Any ideas for looking in to why this might be happening? It seems so bizarre given the specs of the two systems that the macbook would so vastly outperform the PC. In fact, looking around at other threads it would seem that even an equal-spec PC should well outperform any mac with unity. Thank you for any advice you might have.
EDIT: Unity Version: 5.3.2f1
EDIT: Profiler Images:
In comparing the two, it would seem that GC and vsync are both taking much more perf on PC than Mac. Although my script is spiking way worse on PC as well.
PC
MAC
Pure C# code, no OpenCL, Open$$anonymous$$P or other fancy tricks? 64 Bit version of Unity under Windows? If yes in both cases i would suspect that a different C# compiler is used on both platforms, but i couldn't find any information about this.CPU-intensive as it involves a large number of cellular automata.
Also, under OSX OpenGL is used, DirectX under Windows. $$anonymous$$aybe you're doing something in your code that just happens to be much faster with OpenGL or the OSX specific OpenGL implementation.
Thanks for the reply!
I updated the post with screens from the profiler for each PC and $$anonymous$$ac
Answer by jarm__ · Jan 27, 2017 at 10:49 PM
This was finally resolved. It had nothing to do with Unity. It was Windows 7 Power Options. Apparently there's an issue in Windows 7 with CPU parking, where parked CPUs fail to unpark even when the CPU becomes stressed.
This is resolved by switching your Power Options from "Balanced" (the default) to "High Performance"
Answer by jarm__ · Sep 08, 2016 at 08:39 AM
This was solved by deleting my Library folder. http://answers.unity3d.com/questions/814852/unity-project-running-slow-after-running-smoothly.html
Thank you for everyone who looked at this and offered advice.
I feel pretty silly.
The Unity project library folder. After deleting that and re-opening the project, it rebuilt and subsequently ran with expected smoothness.
Ah, i see. I thought in the Unity folder or somewhere in Windows ;)
Thanks!
So this worked at first. The first time I deleted the Library folder and rebuilt, the project ran extremely smoothly on the more powerful PC. In my elation, I didn't take a profiler screen, but the peaks were under 20ms, as opposed to 60ms on the above grab from before deleting the Library folder.
However, the next time I relaunched the project, the slow performance was back. I tried to delete the Library folder again, rebuild and relaunch, but the problem persisted. I tried grabbing the original backup of the project and repeating the process, but the problem persisted. I tried exporting the project as a package and importing into a fresh project, but the problem persisted. I tried deleting the temp files directory, but the problem persisted.
I am at a complete loss. It seems like something has gone wrong in passing the project back and forth from mac to PC, but I cannot find what it is. Am I missing something about how Unity works in terms of editor settings? Is the project pulling in bad settings every single time somehow?
The question is: why does Game_RD_$$anonymous$$aze_01.Update vary so much in execution time on the PC? Is there some code in there that behaves differently depending on Time.deltaTime? Or is there code that waits on completion of other tasks in threads or coroutines?
Dan
Unity Support