{ "id": "147374", "key": "ALOY-1263", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-05-03T07:38:09.000+0000", "created": "2015-04-29T06:40:54.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2018-03-07T22:28:25.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": "13604", "name": "Tooling", "description": "Items related to Alloy tooling and workflow" } ], "description": "Looking for optimisations of https://github.com/appcelerator-developer-relations/Mobile-App-Performance I saw that enable strict mode meant a 20x performance increase on Android and a significant increase on iOS as well.\r\n\r\nUnfortunately, because {{\"use strict\";}} needs to be the first line of the file or function scope and Alloy wraps the original controller code, a developer cannot (simply) enable strict mode. The workaround is to wrap inline controller code in a self-executing function and add {{\"use strict\";}} as the first line for this and every other function.\r\n\r\nhttps://community.appcelerator.com/topic/391/how-to-enable-strict-mode-in-alloy\r\n\r\nh3. Phase 1: Always add strict\r\nWe should probably promote strict mode in our docs, but with Alloy we could even force it. Simply adding {{\"use strict\";}} to all compiled files will only mean a slight decrease of performance if the code is not really strict but a huge increase if it is, as this [StackOverflow user found|http://stackoverflow.com/questions/23997267/using-node-why-is-code-so-much-faster-with-use-strict].\r\n\r\nh3. Phase 2: Correct code to be strict\r\nI'm not sure if UglifyJS maybe already does this, but there's several packages out there that can automatically correct strict lint errors and thus make the code strict for the user (or warn him if it's not).", "attachment": [], "flagged": false, "summary": "Compiler should force \"strict mode\" to increase (Android) performance", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": null, "closedSprints": [ { "id": 882, "state": "closed", "name": "2017 Sprint 09 Tooling", "startDate": "2017-04-23T21:40:51.921Z", "endDate": "2017-05-07T21:40:00.000Z", "completeDate": "2017-05-08T00:27:11.528Z", "originBoardId": 199 } ], "comment": { "comments": [ { "id": "390846", "author": { "name": "nitrag", "key": "nitrag", "displayName": "Ryan Gartin", "active": true, "timeZone": "America/New_York" }, "body": "Any progress on this?", "updateAuthor": { "name": "nitrag", "key": "nitrag", "displayName": "Ryan Gartin", "active": true, "timeZone": "America/New_York" }, "created": "2016-07-17T16:30:56.000+0000", "updated": "2016-07-17T16:30:56.000+0000" }, { "id": "395356", "author": { "name": "francoisvl", "key": "francoisvl", "displayName": "Francois van Lille", "active": true, "timeZone": "Australia/Sydney" }, "body": "I second the motion to get some movement on this, as it sounds so simple a gap to bridge in theory and no-one has claimed anything to the contrary. Given the widely accepted benefits of running strict mode code, surely we could bump this up the list of things to do?\r\n\r\nIf you're working in an editor that supports JS linting (such as Atom, which I believe more and more people are doing), you're bombarded with warnings about unnecessary 'use strict' directives, which I for one would not mind seeing the back of...\r\n\r\nIf a well-placed rant doesn't get the job done, maybe I should pull my finger, fix it myself and submit a pull request, eh? Although a soap-box is so much easier to come by...", "updateAuthor": { "name": "francoisvl", "key": "francoisvl", "displayName": "Francois van Lille", "active": true, "timeZone": "Australia/Sydney" }, "created": "2016-09-05T23:50:29.000+0000", "updated": "2016-09-05T23:50:29.000+0000" }, { "id": "395492", "author": { "name": "andersdp", "key": "andersdp", "displayName": "Anders Dahl Pape", "active": true, "timeZone": "Europe/Berlin" }, "body": "If Francois hasn't pulled his finger ;) I would also like to see this happen! If the performance gain is that massive it's an easy win with many Titanium developers.", "updateAuthor": { "name": "andersdp", "key": "andersdp", "displayName": "Anders Dahl Pape", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-07T08:50:45.000+0000", "updated": "2016-09-07T08:50:45.000+0000" }, { "id": "403421", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "bump\r\n\r\nSomeone raise this priority please. ", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2016-12-15T12:35:29.000+0000", "updated": "2016-12-15T12:35:29.000+0000" }, { "id": "403426", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "body": "Would be nice if this was implemented....\r\n\r\nI have started looking into doing this manually - but would be so much nicer to have it done automatically. If backwards compatibility is an issue then perhaps make it possible use by setting some configuration somewhere on the project... (tiapp.xml perhaps?)", "updateAuthor": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-15T14:32:34.000+0000", "updated": "2016-12-15T14:32:34.000+0000" }, { "id": "417465", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey [~fmiao], can you take a look and scope this out?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-16T14:32:46.000+0000", "updated": "2017-04-16T14:32:46.000+0000" }, { "id": "417632", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "PR: https://github.com/appcelerator/alloy/pull/823", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2017-04-18T23:26:20.000+0000", "updated": "2017-04-18T23:26:20.000+0000" }, { "id": "418999", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We decided to not implement this change at all, because most recent benchmarking tests related to the above PR did not result in an improved Alloy performance. If there are other thoughts on this, please test the PR and let us now, but for now we will go with the current Alloy implementation and expect huge speed improvements in Alloy v2 which will begin planning this week. Thanks!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-03T07:38:09.000+0000", "updated": "2017-05-03T07:38:09.000+0000" }, { "id": "435330", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid. If this is incorrect, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-07T22:28:25.000+0000", "updated": "2018-03-07T22:28:25.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }