Interpret this CPU usage graph- iMac i7 / EyeTv export

Discussion in 'Mac Apps and Mac App Store' started by fobfob, Nov 17, 2009.

  1. fobfob macrumors 6502

    Oct 15, 2008
    Hi folks,

    Just got my i7 iMac the other day. Not all apps use all cores (as expected), but I'm interested to understand this one. Export MPEG2 (TS stream) from EyeTv to AppleTv format (I think it uses quicktime but can't tell).

    Check out the pic. Now there are 4 real cores, but OSX is showing the 8 virtual cores. Anyway, given there are 4 cores, what does it imply to have around 50% total utilisation? Two threads? Four threads?

    I notice that BOINC (einstein@home) only gets up to total utilisation when its running 8 threads. Does this mean that EyeTv (quicktime) is asking for number of cores and then creating that many threads? EyeTv is only showing one line time in Activity Monitor at around 400%.

    Can these utilisation graphs actually be trusted when the 8 cores are virtual?

    Attached Files:

  2. Peace macrumors Core


    Apr 1, 2005
    Space--The ONLY Frontier
    The EyeTV App has been taking advantage of multi-threading for about 6 months now.

    That's a good thing btw.
  3. fobfob thread starter macrumors 6502

    Oct 15, 2008
    But why only 50% of total CPU? The graph is pretty much steady and looks like the above the whole time during the export. No core reaches 100%. Considering that einstein also only uses 50% if 4 threads are launched and bearing in mind that there are only 4 real cores, then it appears that either
    a) you can't rely on these graphs once they reach at least 50% processor utilisation because they don't interpret the hyperthreading properly OR
    b) You can't max out a real core with one thread. You need two. The hyperthreading is "hard coded". For all practical purposes you have an 8 core machine and need 8 threads to maximise performance.

    I think I need to check some PC hardware sites to find the answer.
  4. Makosuke macrumors 603

    Aug 15, 2001
    The Cool Part of CA, USA
    I'm not positive about this, but I believe the 50% CPU utilization you're seeing on the 8 virtual cores is equal to 100% utilization on all four real cores.

    That is to say that there are apparently enough threads to completely max out all the available cores, regardless of what it looks like on the screen.

    If I understand correctly how Activity Monitor handles virtual cores, it would work like this if you had a theoretical single-core CPU with hyperthreading:

    You would see two cores, and in the event you had a single-threded process running flat-out, you would see one core maxed and the other idle, for a total of 50% utilization, though in reality it's essentially doing the same thing as a single core without hyperthreading. With two threads each virtual core would see 50% utilization, because the available clock cycles are being split between the two threads, again for a total of 50% of "apparent" power but 100% of actual. The difference, as I understand it, is that when the CPU distribution is being done by the CPU at hyperthreading level it is more efficient than when the OS splits a single core between two threads.

    In your larger case it's the same basic effect, and if you're seeing 50% total CPU you are maxing out all for actual cores. Phrased differently, the eyeTV process is showing 400%, which means it's maxing out 4 real cores, no matter how it looks on the bar graphs. The 400% is absolute, relative to the speed of a single, real core.

    Activity Monitor just makes it look funny because it displays all of the virtual cores as if they were real ones, not realizing that each pair is effectively "sharing" 100% cycles.

    (I should also add that on my multi-core machines without hyperthreading even a single-threaded app trying to run at 100% CPU won't necessarily show up in Activity Monitor as one maxed core and the other idle--it tends to be divided between available real cores. Whether this is real or just an artifact of how it measures CPU load, I don't know, but regardless if you look at CPU utilization of the task in the list it will show 100%. A two-threaded task would show about 200%. On a four-core machine, 400% is maxed out.)
  5. bjorn989 macrumors member

    Aug 8, 2008
    I have a feeling that the 50% utilisation that you are seeing is due to the way that the i7 overclocks itself in one core if it is using only one core. If it is using all 8 (virtual cores) then it will only use 50% of the potential for each core because to use 100% for each would exceed the heat limits.

    This is all good. The reduction in heat means the processor remains healthy, yet the i7 can use one core to capacity if it needs to for processes that are not optimised for multi-core systems.

    That is my understanding, anyway. Hope this helps.
  6. fobfob thread starter macrumors 6502

    Oct 15, 2008
    Thanks Makosuke, I like the theory. The only problem with this is that why is it that when I run Boinc (einstein@home) with 8 threads, it maxes out all 8 "cores" to 100%, each reporting just under 100% utilisation (total 800%)? According to your theory, each thread should only be running at around 50% and shown as such on the graph.

    I agree that the difference in actual work done between a core (2 virtual cores) running one thread or two is not double. Of course the core is being shared and therefore one cannot hope for double performance if two threads are being run on the one physical core. But I note that several people reckon they get ~30% more actual work done in BOINC with hyperthreading enabled than when it is not. That means that the difference between the graph I posted above, where each virtual core is running ~50% (total 400%) and having 8 threads with each virtual core running 100% is a real positive difference and a benefit, but of course it is not double the performance.

    My conclusions is that with virtualisation, CPU utilisation graphs are not accurate. I wish there was a way to graph CPU utilisation as a percentage of possible throughput, but of course this would vary according to the type of work being done.

    I also think that EyeTV exports (Quicktime?) could be optimised better for an i7 to further utilise hyperthreading on i7, although I agree the difference would not be huge, especially if other apps and tasks are running.

    Any other ideas?
  7. kalamaloo macrumors newbie

    Apr 26, 2010

Share This Page