Engine CPU Usage

Discussion and feedback on Construct 2

Post » Tue Sep 03, 2013 11:11 pm

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.



Rhorho2013-09-03 23:14:52
B
7
S
3
G
1
Posts: 184
Reputation: 1,352

Post » Wed Sep 04, 2013 10:30 am

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.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464

Post » Wed Sep 04, 2013 8:44 pm

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.

Rhorho2013-09-04 20:49:51
B
7
S
3
G
1
Posts: 184
Reputation: 1,352

Post » Wed Sep 04, 2013 10:46 pm

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

B
7
S
3
G
1
Posts: 184
Reputation: 1,352

Post » Sat Apr 16, 2016 2:14 pm

Ashley wrote: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?
B
22
S
3
G
2
Posts: 30
Reputation: 3,693


Return to Construct 2 General

Who is online

Users browsing this forum: newt and 1 guest