Bad performances with intensive text update

Discussion and feedback on Construct 2

Post » Thu Oct 18, 2012 10:21 pm

Hello,

i did a counter for a game (WebGL) and i need to show milliseconds every ticks but it seem there is a huge performance hit when a text object is updated every ticks especially when trying to show fast changing values such as milliseconds in real time, the huge performance hit happen only when showing milliseconds, i bet Construct 2 is doing some king of optimization which prevent the text to be redrawn or something like this so it do not happen with slow changing values.

The game lose almost half fps on Firefox when doing this, however on Chrome it seem the performance hit is very negligible.

Example:

- Create a text object
- Update it every ticks with "time" value
- Monitor "cpuutiisation" value with "time" value and with "int(time%60)"

In my game (on Firefox) the result is:
- CPU Utilisation-> 0.20 with "time" value
- CPU Utilisation-> 0.80 with "int(time%60)" value

Can it be improved or is there a workaround?afgho2012-10-18 22:23:03
B
6
S
1
G
1
Posts: 18
Reputation: 1,004

Post » Fri Oct 19, 2012 12:01 am

Can you share a .capx? Sometimes settings in your project you haven't described affect the problem.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Oct 19, 2012 12:46 am

https://dl.dropbox.com/u/64479453/timer.capx

This display a simple timer "min:sec:ms", in Firefox press space to switch the display to "min:sec" and watch out the CPU utilisation between both.

Made a blank loop as well so the cpu utilisation is an approximation of the cpu use in my game.

Result here:
~0.80 for m:s:ms
~0.35 for m:s
B
6
S
1
G
1
Posts: 18
Reputation: 1,004

Post » Wed Oct 24, 2012 12:13 am

Any ideas? Might just be Firefox js performance but it is a bit strange as performances are almost the same as Chrome without intensve text update.
B
6
S
1
G
1
Posts: 18
Reputation: 1,004

Post » Sun Oct 28, 2012 7:40 pm

Did further tests on an EEEPC, the game is running at 12 fps with a timer milliseconds displayed every frames, without it run at around 28 and it is on Chrome, i don't have anything much going on than just the constant text update...

Is constant text update really that bad?
B
6
S
1
G
1
Posts: 18
Reputation: 1,004


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests