{ "id": "97860", "key": "AC-2888", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-08-06T10:43:46.000+0000", "created": "2012-07-23T23:44:29.000+0000", "labels": [ "addeventlistener", "event", "postlayout" ], "versions": [], "issuelinks": [], "assignee": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "updated": "2016-03-08T07:47:51.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "I found a potentially big problem with the event queue.\r\n\r\nMy application uses a lot of animations and a few of my views listen for 'postlayout' events (because they need to layout upon size change).\r\n\r\nas all events are queued in the same context, you especially get 'postlayout' events and buttons 'click' events in the same queue.\r\nIn my case i was showing a view with something like 10 views animating (slidein, slideout), this triggered something like 2000 'postlayout' events.\r\nThen just after that if the user triggered a button, it took about 1.5 sec for that event to be processed. Why? because there was 2000 events to process first (event if the associated js callback did nothing).\r\n\r\nIf i stop listening for \"postlayout\" events, then everything goes smoothly. \r\n\r\nI think something needs to be done about this, i dont think 'postlayout' events should, in any case, slow down the process of other events.\r\nMay be we could use different event thread, or may be we could reduce the number of 'postlayout' events (dividing into 'resize', opacity, ....)\r\n\r\nWhat do you think?\r\nI am willing to work on this one , but i need help figuring out the best solution. Especially because i still know very very little about kroll bridge context ....", "attachment": [], "flagged": false, "summary": "[ios] event queue and postlayout event.", "creator": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "environment": "Ti 2.2.0 (master)\r\nOSX lion\r\nios 5.1", "comment": { "comments": [ { "id": "209287", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-07-25T01:47:44.000+0000", "updated": "2012-07-25T01:47:44.000+0000" }, { "id": "209521", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "My problem is not with when 'postlayout' event are fired, but on which thread.\r\nBut you are right, if less 'postlayout' events would be fired, it would be better. But i still think it s another problem", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-07-26T02:18:56.000+0000", "updated": "2012-07-26T02:18:56.000+0000" }, { "id": "209915", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "updateAuthor": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-07-26T15:02:36.000+0000", "updated": "2012-07-26T15:02:36.000+0000" }, { "id": "210389", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "It s a hundred times better, and i really mean a hundred time!.\r\nNow i never get more than 50 events in the queue, even with all my animations.\r\nSo i guess it solves my issue, but isnt it just a temporary fix?\r\nI mean buttons event should have priority over other events such as postlayout events.\r\nThat bug is gonna come back.\r\nFor example i am working on a motion module to get gyroscope ...It can fire events at 100Hz so i am almost sure it will come back ;)\r\nBut for now i am good, so i guess this one can be closed", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-07-30T01:44:18.000+0000", "updated": "2012-07-30T01:44:18.000+0000" }, { "id": "212106", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "body": "Closing this issue.", "updateAuthor": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-08-06T10:43:46.000+0000", "updated": "2012-08-06T10:43:46.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }