text performance issue

Hi!

Has anyone had any performance issue with updating a text on each frame?

when i am updating a score text on each frame, i feels like the framerate drops significaly. at least in the corona simulator.
Thats pretty weird sense i’m having a lot of graphics and animations, and the framerate is constant 60 fps until i add the score text.
[import]uid: 103182 topic_id: 21022 reply_id: 321022[/import]

Are you sure you aren’t adding a new text object each frame, eating up all of your memory? I’ve done that a few times before with similar results. [import]uid: 120 topic_id: 21022 reply_id: 83012[/import]

Nope.
I’m using a single text object that i’m updating using the :setText function.
Its not a brutal performance drop, but its still there and a bit anoying. =/

I’v tried using the system font the verify that it wasnt the custom font that was causing the problem.
[import]uid: 103182 topic_id: 21022 reply_id: 83016[/import]

Can I ask why you’re using Runtime to update the score text? Could you not do it in the same function as the points are actually scored? (If you can avoid a Runtime listener obviously that is preferable.)

Peach :slight_smile: [import]uid: 52491 topic_id: 21022 reply_id: 83088[/import]

Hello Peach!
Yes that would definitly be better, but that wouldnt make much difference since my score is more or less updating every frame anyways. I could ofcourse use a timer instead that updates the text a little less frequently, but that isnt as nice as doing it on each frame.

It is still strange that if i remove the text completly and insted replace it with my particleengine, wich is emiitting 150 particles/s, it still moves more smoothly then when the text is rendered.

Maybe its just the simulator, i haven’t tried it on device yet.
[import]uid: 103182 topic_id: 21022 reply_id: 83159[/import]

Hey again,

Wow, OK, so your score updates a LOT then - I was picturing something more like the score in a platformer.

I would be interested in hearing how it went on device; can you update this thread when you’ve tested, please?

Peach :slight_smile: [import]uid: 52491 topic_id: 21022 reply_id: 83273[/import]

I think I can confirm that text rendering is way too slow to update on a per-frame basis. I have a stretchable text box that the user can size/move via touch. Since you cannot update the width/height of an existing text object (well, you can, but it isn’t going to do anything useful), you have to destroy and recreate the text object each time. Corona can’t even keep up with the speed of the touch events on an iPhone 4 (there are around half a dozen objects in the scene, and the addition of the text update brings the iPhone 4 to a crawl).

I’m not sure what kind of brain surgery is being performed to create a text object, but it’s not safe to try to do on a per-frame basis, unfortunately. I’m experimenting with workarounds now, assuming that it’s going to have to be something WAY faster if it has any prayer of working on a 3GS or any Android device. [import]uid: 111481 topic_id: 21022 reply_id: 106425[/import]

If you can whip up a simple test example case that simply shows poor framerate/performance when updating text objects, please submit it here so we can investigate: http://developer.anscamobile.com/content/bug-submission [import]uid: 84637 topic_id: 21022 reply_id: 106836[/import]

@Danny,

I actually got my app working. I was trying to do an update of a text object on a touch event (a multitouch pinch/zoom). Turns out the touch events come ridiculously fast and close together on iOS and Corona couldn’t keep up (again that’s just with one text object). I throttled my gesture processing so it only processed touch events on a 50ms granularity and that was enough to get it work.

Regarding submitting a bug, I think I’m going on strike as far as bug submitting goes. I have 15 open bugs right now. It has not been my experience over that past several months that spending the time and effort to write a bug is worth it, given the low and slow fix rate (and the fact that most of them get put so far on the back burner that they’ll never get fixed). So my current rule is that unless it prevents me from shipping my app, I don’t event bother to report it. Best case is it’s just going to distract you from the showstoppers that are already on your plate.

When my bugs start getting fixed, or when the overall open bug count gets to a manageable level, then I’ll start submitting again (I have a backlog of 5-10 unreported ones where it just didn’t seem worth the effort to write a sample).

Bob
[import]uid: 111481 topic_id: 21022 reply_id: 106926[/import]

Glad to hear you got it woking bob. Im dissapointed to hear your outlook. With the new development scheme in place and the way things are moving forward with ouR engineering, i hope you will reconsider your viewpoint.

One thIng that slows down getting to legitmate cases is people filing bug reports that are simply errors with there own code and claiming its a corona bug, we get literally hundreds of these a week. [import]uid: 84637 topic_id: 21022 reply_id: 107091[/import]