Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Touch moved event firing too quickly ?
Started by Tapps - enterprise Sep 24 2014 12:09 PM

34 replies to this topic
[TOPIC CONTROLS]
Page 2 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

@Tapps,

 

I've heard that you are still have performance issues with you touch event.  I'm wondering, are you updating text with the "Font-Manager" bitmap font library via your touch listeners?  It's come to my attention that the "Font-Manager" library has performance issues due to a lot of wasteful string parsing and regular expression it does every time you update a small amount of text.  During my testing, I've discovered that updating a small amount of text via "Font-Manager" can take about 15-30 milliseconds.  I shared my findings here...

   http://forums.coronalabs.com/topic/53450-performance-problems-with-newtableview/?p=279041

 

So, if you are using the free "Font-Manager" library, then that might be the cause.

The "bmFont2" bitmap font library was a lot faster during my testing.

I haven't tried "TextCandy" yet.



[TOPIC: post.html]
#27

Tapps - enterprise

[GLOBAL: userInfoPane.html]
Tapps - enterprise
  • Enthusiast

  • 75 posts
  • Corona SDK

Hello Joshua,

 

In this particular case, we are not updating any text based on the touch event or making large network requests. The behavior we see is that dragging in it self seems ok, although a bit slower than in other platforms, but the we see a big delay between dragging the finger across the screen and the object actually moving.

 

We tried to update the position only once per "enterFrame" event but didn't see any noticeable improvements. Something that we noticed during our tests is that the performance of the touch is related to number of display object on screen, even if they are static.

 

We are trying to find more stuff to test, see what could be causing this, any ideas ?



[TOPIC: post.html]
#28

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 907 posts
  • Corona SDK

Just to reinforce Tapps' comment, it pretty much covers what happens to us too.

Updating positions only once per frame, but the frame time gets slammed when moving so there is a big delay between moving your finger and the object moving. You end up with very jumpy movement.



[TOPIC: post.html]
#29

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Odds are its what's being updated/rendered is what is causing the performance issue that you 2 are seeing.  Would you 2 mind sending us your projects?  This way it'll be a lot easier for us to isolate what the issue is, because right now I'm just guessing and I have no idea what you are running into.  I can get you 2 in contact with David to send us your projects securely if you're willing.

 

Edit:
Alternatively, you can zip up your project and send it to us via the "Report a Bug" link at the top of this page.  There is a size limit though (I think it's 30 MB) so you should make sure to "Clean" it first (ie: delete the compiled files).



[TOPIC: post.html]
#30

DavidRangel

[GLOBAL: userInfoPane.html]
DavidRangel
  • Moderator

  • 888 posts
  • Corona Staff

Hey guys - as Josh mentioned, he hasn't been able to reproduce. So we would need to get your project (or a subset of it) that shows the issue.

 

Feel free to email me directly (david AT coronalabs) to arrange this.



[TOPIC: post.html]
#31

Tapps - enterprise

[GLOBAL: userInfoPane.html]
Tapps - enterprise
  • Enthusiast

  • 75 posts
  • Corona SDK

Hey guys,

 

I'll try to send you a subset of the project as soon as possible. Meanwhile, if you want to take a look on the app, here is the link to it one on the Windows Phone store.

 

http://www.windowsphone.com/en-us/store/app/solitaire-premium/00afedc8-a9a1-4e1f-8dc3-140f016da0f3

 

This is the game that we the delay is more noticeable, but it still happens in varying degrees on all apps. We have done our tests on a Lumia Nokia 520.



[TOPIC: post.html]
#32

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

I just downloaded and played with your app now.  I can definitely see the slowness issue that you're talking about... but I'm thinking that it might be caused by the timer text object you have in the top-right corner.  If you're using that "Font-Manager" bitmap library to update that text, then that might be the cause.  Try disabling the text updates in the top right corner to confirm that this is the issue.



[TOPIC: post.html]
#33

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 907 posts
  • Corona SDK

Thanks David/Joshua - it's a bit hectic here as we're in the middle of iOS/Android submissions at the moment, but once we're back onto WP8 again I'll send over the project.



[TOPIC: post.html]
#34

Tapps - enterprise

[GLOBAL: userInfoPane.html]
Tapps - enterprise
  • Enthusiast

  • 75 posts
  • Corona SDK

Hey Joshua,

 

We are not using the Font-Manager lib. There was an old bitmap font lib on the Corona Projects that we refactored / improved to make it compatible with graphics 2.0 and our own custom libraries. But I did find some answers to the problem.

 

While cutting parts of the project away to send to you guys, I noticed that the drag issue was getting better. Then, following your suggestion about the timer, Isaw that it was being updated more frequently than it should. Reducing the update time also solved the drag problem, even keeping most of the project intact.

 

My guess is that it wasn't a single part of the project that was causing the delay, just that the device was indeed "overloaded" and could not process the input fast enough. In the previous tests I was too focused on the event part, trying to find what could be causing it and ended up missing what was happening on the rest of the project.

 

Well, I'll do some more tests on the other games to see what we change to improve performance and see if we have similar results. If I find anything that seems weird I'll keep you posted.

 

Thanks for the help!



[TOPIC: post.html]
#35

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Happy to help!

And yeah, if you find anything weird, please feel free to let us know.  :)




[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]