Engine CPU Usage

  • Hi,

    I'm new to C2 but enjoying it so far. I'm especially enjoying the insight that the profiler is giving. So I have a question.

    I've been developing up a test system to learn C2 concepts and I was flagging my CPU usage every second in a text message. I was averaging 2-3%, not a lot was happening.. mostly trying out a few sprite-based buttons, etc.

    Anyway, I've since started exploring XML, other memory structures, etc and my ENGINE usage is up to 10-12%, EVENTS are stuck at 1%, DRAW is at about 1% though it can peak. This could also be the time I swapped from R139 to R141 but my recollection is fuzzy on the timing.

    I am curious what drives the ENGINE usage as I must have done something that made it worse. I'm not worried about debugging what I coded, but I'm curious to know what is good practice to keep engine usage low and how does engine usage relate to what my code does (eg number of events and memory structures)

    For information, windows 8 machine, using R141, similar performance on IE10 and Firefox 23.0.1

    PS: the new debug tool is fantastic for chasing down problems. Much appreciated.

    Rho

  • Engine time is the frame time not spent in events, physics or draw calls, i.e. just the overhead of the C2 engine. You should note that the measurements are all approximate, and 10% is still pretty low, so it may well be fine.

    Engine time includes "ticking" objects, such as stepping sprite animations, moving any objects with movements, other behavior tasks e.g. searching for targets with the Turret behavior, and anything else that needs tick-by-tick attention by the engine that is not covered by events.

  • thanks Ashley.. so probably need to watch for ticking events. However I did a quick test and killed all ticks but cpu still high.

    If I find out what's causing the issue, I'll send you more info.   thanks again for the quick response.

    Rho

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley, I did a bit more digging... slowly deleting everything from the design. It was a textbox that did it. added 10% to the CPU usage. Would this make sense?

    I am going to post this over in the bug section. A standard textbox should not start consuming most of a CPU core.

    R

  • Engine time includes "ticking" objects, such as stepping sprite animations, moving any objects with movements, other behavior tasks e.g. searching for targets with the Turret behavior, and anything else that needs tick-by-tick attention by the engine that is not covered by events.

    @Ashley - Is there any way to check exactly what kind of operations / which operations in "Engine time" category affect the CPU usage?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)