Different execution speed with idle vs heavy-load CPU - macos

Fellow colleagues,
I'm currently working on a PowerPC emulator written in C++. In order to evaluate its performance, I'm using std::chrono:high_resolution_clock to measure execution time of a guest code block for that the number of CPU cycles is known. The corresponding code is located here: https://github.com/maximumspatium/dingusppc/commit/11b4e99376e23f46f4cd8ee6223c5788ab963a37
While doing the above tests, I noticed that my MacBook Pro reports different numbers depending on CPU load. That is, when I run the above code with idle CPU I'm getting about 230000 ns execution time while with heavy-loaded CPU (neural net training, for example) I'm getting much better performance (< 70000 ns).
I suppose it's related to threads and scheduling in macOS. I'd like to utilize the full CPU power in my emulator. Is there a way to change thread performance to run at full speed, just like it does when the CPU is running under heavy load?
Thanks in advance!
P.S.: The machine in question is MacBook Pro 17ยดยด Mid 2010 with 2,53 GHz Intel Core i5 and 8GB RAM running MacOS 10.13.6.

Related

How does memory usage in Windows affect performance

I'm running windows 10 with 4GBs of DDR3 1066 on Intel second generation i5 mobile architecture.
I come from a OSX background mostly and memory has always been a concern for me because I prefer to have many tabs open. I noticed on OSX that the memory usage didn't relate that much to the performance of the applications so long as it wasn't fully saturated but easily on my iMac I can run 80% of memory and find no noticeable lag or stuttering. However on Windows I'm finding memory to be the major bottleneck in my system, I understand that upgrading to 8 or 16GBs of memory would be the upgrade path for me. However I would love to understand why my system slows down noticeably when I saturate 80% of the memory unlike OSX that seems to handle it just fine. Is it a bandwidth limitation? I know that Windows NT and Darwin are completely different Kernels and I would love to be educated in exactly how that affects the same usage scenario so differently.
Thank you in advance.

Can Xcode utilize 64GB RAM or greater?

I have a MBP with 16GB of RAM. As projects grow in Xcode, the compile time does take longer. I'm looking into starting a hackintosh project purely for shortening Xcode compilation time. Since RAM is cheap, I wanna push the normal boundaries. But the biggest question is will Xcode be capable of using all the RAM greater than 32GB? I know there will be some diminishing marginal returns at some point of RAM increase.
RAM usage is mostly governed by the OS, because the Mac Pro does support up to 64GB of RAM, so should OSX (and by extension XCode).
Although I wonder if your compile time issues are actually RAM-related. I have Xcode projects that take minutes to build and it's all because my CPU is pegged at 100% (using a mid-2015 15" retina MBP). Not many software projects are RAM-constrained past 16GB.

Visual Studio Load test CPU Usage

I'm running visual studio 2013 ultimate load test in my local system which has i7-3840QM processor, SSD with 2.8GHz processor.
My load scenario is ramping up 50 users for every 30 seconds upto 500 users. When I checked my CPU usage, it shows 100% and looks like its using all 4 cores. (Please see the attached screenshot)
Here are my questions:
1. Is it OK to continue the test when CPU usage shows 100%?
2. Do we have anything like "Load Test Virtual User Pack 2010" for VS 2013 version?
3. What are other options available ? (I'm planning for Test Rigs, if the single system doesn't work)
Appreciate any help.
Could you do some profiling? First profile CPU and find which processes are hogging the CPU, For the CPU hogging process, find the function(s) that cost most of the CPU cycles. Intel VTune is a great commercial profile. For open source one, you can try valgrind.
Good luck.

Different audio quality between Mac Pro and MacBook Pro with the same xcode Release

I wrote a program with xcode (using portaudio) on a MacBook Pro (Intel Core 2 Duo 2.66 GHz). The Release works without problem (clear audio streaming) and the CPU Usage Level is almost 90%.
The problem arises when i run the Release on a Mac Pro (Quad Core Intel Xeon 2.8 GHz). The audio stream, when there is a large amount of computation, isn't clear (there are little clicks) despite the use of the CPU is four times lower than the one of MacBook Pro.
I can not understand why this happens.
25% CPU usage in a 4 core system means one core is 100% loaded. Also, I assume the Xeons are Pentium4 Xeons, which have way worse CPU cores than the Core2Duo, even though the clock frequency is a bit higher...

Decreasing performance of dev machine to match end-user's specs

I have a web application, and my users are complaining about performance. I have been able to narrow it down to JavaScript in IE6 issues, which I need to resolve. I have found the excellent dynaTrace AJAX tool, but my problem is that I don't have any issues on my dev machine.
The problem is that my users' computers are ancient, so timings which are barely noticable on my machine are perhaps 3-5 times longer on theirs, and suddenly the problem is a lot larger. Is it possible somehow to degrade the performance of my dev machine, or preferrably of a VM running on my dev machine, to the specs of my customers' computers?
I don't know of any virtualization solutions that can do this, but I do know that the computer/CPU emulator Bochs allows you to specify a limit on the number of emulated instructions per second, which you can use to simulate slower CPUs.
I am not sure if you can cpu bound it, but in VirutalBox or Parallel, you can bound the memory usage. I assume if you only give it about 128MB then it will be very slow. You can also limit the throughput on the network with a lot of tools. I guess the only thing I am not sure about is the CPU. That's tricky. Curious to know what you find. :)
You could get a copy of VMWare Workstation and choke the CPU of your VM.
With most virtual PC software you can limit the amount of RAM, but you are not able to set the CPU to a slower speed as it does not emulate a CPU, but uses the host CPU.
You could go with some emulation software like bochs that will let you setup an x89 processor environment.
You may try Fossil Toys
* PC Speed
PC CPU speed monitor / benchmark. With logging facility.
* Memory Load Test
Test application/operating system behaviour under low memory conditions.
* CPU Load Test
Test application/operating system behaviour under high CPU load conditions.
Although it doesn't simulate a specific CPU clock speed.

Resources