Regarding the inspector and performance

Discussion and feedback on Construct 2

Post » Wed Oct 22, 2014 1:57 am

What wondering about the resources that the inspector uses. I know that it does hurt performance when using it. But it seems to use a lot more resources that you would expect, the reason for my wondering is because my current program is very small (207 events) and 49 objects, however when in the inspector (Inspect mode, System) it uses between 20-49% CPU and a FPS drop of about 6 to 13, which i find to be quite a lot for a program of this size.

If I switch to "Profile mode" to see what is using these resources it instantly drop to 0% CPU and 60 FPS indicating that nothing is being used, which I would expect as nothing is really happening in the game in its current state.

Also if i switch to any other object than the "System" it again goes to 0% CPU with no FPS drop.

So something in the system tab seems to use a lot of unnecessary resources, whatever it is that does it, i think it would be better to remove that part of the system, because it seems to provide inaccurate data while in that tab.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Wed Oct 22, 2014 12:00 pm

The browser has to do a lot of layout and text rendering as the inspector stays up to date. Note it displays data in real-time and keeps the object list up to date etc. That has quite a big performance impact. AFAIK, the only way to avoid that impact is just to not display it. If you switch to a different tab it should be faster.
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,842

Post » Wed Oct 22, 2014 12:56 pm

Ashley wrote:The browser has to do a lot of layout and text rendering as the inspector stays up to date. Note it displays data in real-time and keeps the object list up to date etc. That has quite a big performance impact. AFAIK, the only way to avoid that impact is just to not display it. If you switch to a different tab it should be faster.

That's what puzzles me, because the system tab doesn't really show a lot of information, besides the "Performance", "System", "Current layout" and all the layers. So there are no specific object information here. But if I switch to an object tab, the other objects are still kept up to date, but there are no performance drop. So it just confuses me that the only tab that doesn't show specific object information is the one suffering the performance hit from keeping real time data of something that is not available in that view, but are available in the other tabs with no performance issues. Which I would assume that if the other tabs are also able to keep the data up to date in real time, why wouldn't these tabs suffer a performance hit as well?
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Wed Oct 22, 2014 2:19 pm

It's nothing to do with which object is selected, it's just the amount of information being displayed in the tables. The system tab does show a lot of information!
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,842

Post » Wed Oct 22, 2014 3:22 pm

Ashley wrote:It's nothing to do with which object is selected, it's just the amount of information being displayed in the tables. The system tab does show a lot of information!

I did some testing just for fun and done know if it useful in anyway. But I added all the system information to the watch.

There are 9 layers.

And this is what it shows:
Image
It jumps between 25% to around 40% CPU

So I tried removing "Time", "Wall clock time" and "Tick count" from the watch and this is what I got.
Image
Here it jumps between 0 and 4%

Another test, if I leave everything on watch, but remove all the things in "Performance" except "Est. CPU untilisation" and "Frames per second" this is what I get:
Image
And it will jump between 17% to around 23%

But if I remove either "Est. Cpu utilisation" or "Frames per second" not both of them but just one. then I get this:
Image
And it will jump around 54% to 60% which is a bit weird.

If I remove the "Time", "Wall clock time" and "Tick count" as well then I get this:
Image
And it will stay at a solid 0%.

Anyway not sure its useful, but it seems that depending on what stuff it is told to keep track of, will lead to significant different results, which ofc makes sense. But if the data it gives you varies so much depending on this, then the information it provide is not really reflecting the performance of your game, but rather that of the web browser, if I understood you correct?. And think that would be a bit sad, if that's the case.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Wed Oct 22, 2014 3:40 pm

Yeah, the inspector only needs to update when values change. So if no values are changing, it doesn't have to do anything. On the system tab the time and tick values keep changing, so there's lots of work for the browser there. That's all. If you're interested in performance then you should be looking at the performance tab anyway, which doesn't have the inspector overhead. It's common in other tools (including C++) that debug mode reduces performance.
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,842

Post » Wed Oct 22, 2014 4:00 pm

Yeah I understand that, but I don't see the logic in what you are saying if I watch either "Est. CPU util" or "Frames per second", not both of them. Then the CPU usage goes from 0-4% to around 54-60% but if both of them are being watched it only jumps to around 17% to 23%. It should be the other way round, if both of them are used it should also be the highest CPU usage increase and not the lowest, as it would have to keep track of more.

But the increase in CPU Usage only happens if "Time", "Wall clock time" and "Tick count" are also being watched. If these are removed, then the CPU goes to 0% when one is used, and to around 3-4% if both are being watched.

Maybe im just misunderstanding you :D and its not easy to figure it out I think when reading the numbers, But it seems that "Time", "Wall clock time" and "Tick count" uses a lot of resources. And maybe being able to disable these could improve the system tab by a lot.

If I add only one of them "Time", "Wall clock time" or "Tick count" and remove the "Performance" all together, the "Tick counter" for instant will increase the CPU Usage to 25-30% from 0% on its own.

EDIT:
But it will only happen if there are layers being watched as well, if there are none it will hardly use any CPU 1-2% when watching these 3 alone and adding the Performance as well doesn't have a huge impact either. But when layers are being added the CPU Usage with the "Time", "Wall clock time", "Tick count" increases by approx. 3-4% per layer it seems. which seems to fit pretty well with the 25-30% cpu increase when one of these are added with 9 layers.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Sat Jan 10, 2015 12:05 pm

If collision checks/sec in my project is 400-500/tick, what i should change to get better result?
B
109
S
26
G
46
Posts: 1,887
Reputation: 35,170


Return to Construct 2 General

Who is online

Users browsing this forum: monikarr6 and 14 guests