+ Reply to Thread
Results 1 to 4 of 4

Thread: CPU/Rendering Optimisation Question

  1. #1
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default CPU/Rendering Optimisation Question

    Hi Zorba,

    Could you confirm something for me please?

    When I check through Inspect.Addon.Cpu, I can see entries for "<context> render time" and "<context> update time".

    Are these values completely dependent on the complexity of the frame hierarchy, or do they also include time spent within any of the addon's event handlers?

    I'm basically wondering if there is any code optimisation I can look at to reduce the CPU on these items, or if it's purely a factor of the complexity of the addon's UI? (they account for a major percentage of my addon's CPU usage at the moment)

    Thanks,

    - Wild

    Gadgets: Unit Frames and Other Stuff for RIFT

  2. #2
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Never mind, I think I just confirmed it myself by logging CPU usage to the chat log, and then hiding the user interface (CTRL-U). It looks like those items are purely for the time spent by the native code rendering the frame hierarchy.

    It makes quite interesting viewing. For the addon I'm working on, and also for SimpleMeter which I ran the same check on as I happened to have it loaded, the complexity of the frame hierarchy is a much bigger factor in CPU usage than whatever the event handlers are doing.

    Gadgets: Unit Frames and Other Stuff for RIFT

  3. #3
    Telaran
    Join Date
    Mar 2012
    Posts
    72

    Default

    The other odd item I noticed with CPU usage was that it doesn't always seem to correlate to any actual increase in CPU on my system.

    Eg in my addon I opened 70+ unit frames, CPU usage was around 50% for the frames, but I didn't really see much change in actual CPU usage in task manager (perhaps perfmon would have been a better measure)

    I actually not sure that CPU usage is really you're using that %age of a core in the system.

    The other fun thing is depending on what the addon is covering/IE am I looking at the floor or sky I've seen cpu usage change...

  4. #4
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Quote Originally Posted by Mere View Post
    The other fun thing is depending on what the addon is covering/IE am I looking at the floor or sky I've seen cpu usage change...
    I think we're seeing the percentage of Rift's main thread's CPU usage that our addon is using, so if the main thread is using 50% of a core, and we're reporting 10% on our addon, we're actually using 5% of a core.

    That would explain CPU usage changing when you look at the floor. The game engine will work out which objects are in your viewing frustum, and cull anything it can't see. This means the main thread is using less CPU overall, so the percentage of this attributable to our addons will appear to go up.

    Hmm... that was kinda confusing...

    When it's busy...

    Game Thread Total CPU work = 1000
    Addon CPU work = 100
    Reported Addon % = 10%

    When it's idle...

    Game Thread Total CPU work = 500
    Addon CPU work = 100 (unchanged)
    Reported Addon % = 20%

    (work being a made up example measure of how many processor cycles were used up)

    Gadgets: Unit Frames and Other Stuff for RIFT

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts