High Performance Code on Mac OS X

I would like to know the best way to profile application code on OS X. I have a timer with nano-second resolution, and after some basic testing it seems like I'm in the syscall kernel context switch about 45 micro (macbook 2ghz core2 duo).

I noticed that if I let my application cycle from time to time, I can get a planning context switch of around 25,000-50,000 micro. I am testing some algorithms and I want to limit their consequences.

What I really want is to adjust the proximity of the processor to the task, and set the priority of the main thread in real time, which is not so bad, because one day this Macbook can be used as a controller with a low delay for something. Any ideas on how to do this on the Snow Leopard / Xcode?

+4
source share
1 answer

You can use Shark in Xcode. There is also DTrace.

+1
source

Source: https://habr.com/ru/post/1393574/


All Articles