{ "id": "107740", "key": "ALOY-455", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14634", "description": "Alloy 1.0.0", "name": "Alloy 1.0.0", "archived": false, "released": true, "releaseDate": "2013-02-19" }, { "id": "14871", "description": "2013 Sprint 02", "name": "2013 Sprint 02", "archived": true, "released": true, "releaseDate": "2013-01-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-01-18T16:48:12.000+0000", "created": "2013-01-11T10:42:23.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "GA-candidate", "notable" ], "versions": [], "issuelinks": [ { "id": "24666", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "inwardIssue": { "id": "107689", "key": "ALOY-460", "fields": { "summary": "ScrollableView with noticeable lag when swiping between views", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "25604", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "108875", "key": "AC-2714", "fields": { "summary": "Alloy on/off/trigger for View is not returning the View itself", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "24452", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "107741", "key": "TIDOC-974", "fields": { "summary": "Remove \"Event Handling\" section of Alloy Controller guide", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": null, "updated": "2018-03-07T22:25:59.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "To this point Alloy was adding Backbone eventing functions to the Titanium proxies that are generated from the XML markup. This added the {{on()}}, {{off()}}, and {{trigger()}} functions to proxies that essentially served the same purpose the proxies' traditional {{addEventListener()}}, {{removeEventListener()}}, and {{fireEvent()}} respectively. This was some experimental functionality to see if Alloy could enhance the event handling on proxies without needing changes from the platforms themselves. \r\n\r\nUnfortunately, though, in doing some deep functional and performance testing prior to the upcoming Alloy 1.0.0 GA release I found that adding the Backbone eventing to each proxy was significantly increasing the time necessary to generate those proxies. Due to the nature of the native platform relationship proxies have in Titanium, it's impossible to augment them without this overhead. The following example shows creating 10000 Ti.UI.Views with traditional Titanium dev and Alloy dev. \r\n\r\n{code:javascript}\r\nvar iterations = 10000;\r\nfor (var k = 0; k < 5; k++) {\r\n\tvar start = new Date().getTime();\r\n\tfor (var i = 0; i < iterations; i++) {\r\n\t\tvar bob = Ti.UI.createView();\t\r\n\t}\r\n\tvar end = new Date().getTime();\r\n\tvar time = end - start;\r\n\tTi.API.info('Traditional time: ' + time);\r\n\t\r\n\tstart = new Date().getTime();\r\n\tfor (i = 0; i < iterations; i++) {\r\n\t\tvar bob = A$(Ti.UI.createView());\t\r\n\t}\r\n\tend = new Date().getTime();\r\n\ttime = end - start;\r\n\tTi.API.info('Alloy time: ' + time);\r\n}\r\n{code}\r\n\r\nThe output of the above app on my machine was as follows:\r\n\r\n{code}\r\n[INFO] : \b\b \bTraditional time: 288\r\n[INFO] : \b\b \bAlloy time: 1558\r\n[INFO] : \b\b \bTraditional time: 304\r\n[INFO] : \b\b \bAlloy time: 1543\r\n[INFO] : \b\b \bTraditional time: 252\r\n[INFO] : \b\b \bAlloy time: 1619\r\n[INFO] : \b\b \bTraditional time: 350\r\n[INFO] : \b\b \bAlloy time: 1633\r\n[INFO] : \b\b \bTraditional time: 294\r\n[INFO] : \b\b \bAlloy time: 1535\r\n{code}\r\n\r\nSo as is apparent here, the {{A$}} function that adds backbone eventing to the proxies significantly slows down proxy creation. For this reason, in the 1.0.0 GA for Alloy, I will be removing all Backbone eventing on all proxies generated from markup. \r\n\r\nWhat does this mean? Essentially, if you were using on(), off(), and trigger() on your proxies, go back to using addEventListener(), removeEventListener(), and fireEvent(). That's pretty much it. Be aware that the Alloy controllers themselves will still have Backbone eventing, as will of course the models and collections. Only the proxies created from Alloy XML markup will be affected.\r\n\r\nAll samples and documentation will also need to be updated to reflect the absence of backbone eventing on proxies.", "attachment": [], "flagged": false, "summary": "Remove Backbone eventing from Titanium proxies", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "234991", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The Alloy.A() wrapper function that added Backbone eventing to Titanium proxies built from markup has been removed. All references used in Alloy to that function have been removed. All use of on()/off()/trigger() functions in Alloy code has been removed. All test apps that utilized these functions have been replaced with addEventListener()/removeEventListener()/fireEvent() respectively.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-18T16:48:12.000+0000", "updated": "2013-01-18T16:48:12.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }