{ "id": "169709", "key": "TIMOB-25240", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20033", "name": "Release 9.0.0", "archived": false, "released": true, "releaseDate": "2020-03-18" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-02-01T01:55:40.000+0000", "created": "2017-09-06T21:32:11.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "build", "performance" ], "versions": [ { "id": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "issuelinks": [ { "id": "56163", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "168419", "key": "TIMOB-24829", "fields": { "summary": "Hyperloop: Android - Slow Compile-time, too many JS-wrappers generated", "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": "Critical", "id": "1" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-02-01T01:55:43.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "While working on TIMOB-24829 i noticed a few more things in the android build that can be improved, resulting in a faster build time on incremental builds.\r\n\r\nCompared to the iOS build, which only takes ~5s for incremental builds, the Android build is much slower with ~30-40 sek. Most of the time is spend on recompiling and dexer operations, which are unnecessary if nothing related changed.\r\n\r\nThe Android builder already contains a lot of comments about what can be skipped or cached, but contains no actual code that would do that. The actions in particular are:\r\n\r\n- Compile java classes (only needs to be done when files in {{build/android/src}} or {{build/android/gen}} change\r\n- Run Proguard (only needs to be done when any java classes changed)\r\n- Run dexer (only needs to be done if any libraries changed, any files in {{build/android/bin/classes}} have changed or debugging/profiling was toggled. This alone will cut down the android build time by approximately one third.\r\n\r\n\\\\\r\n----\r\n*Final Result:*\r\nBelow are the performance improvements between Titanium 8.3.0 and 9.0.0 with [kitchensink-v2|https://github.com/appcelerator/kitchensink-v2] on a 15\" MacBook Pro 2015 with a solid state drive.\r\n{code}\r\nNon-encrypted emulator builds:\r\n- Clean Build: 52s -> 20s (2.6x faster)\r\n- Incremental: 18s -> 7s (2.6x faster)\r\n\r\nEncrypted device/production builds:\r\n- Clean Build: 53s -> 21s (2.5x faster)\r\n- Incremental: 50s -> 14s (3.6x faster)\r\n\r\nNotes:\r\n- Benchmarks exclude gradle daemon startup of ~5s which is a one time hit.\r\n- Titanium did not support encrypted incremental builds before. This is new.\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Improve incremental build times", "creator": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 1175, "state": "closed", "name": "2019 Sprint 26", "startDate": "2019-12-16T06:12:12.044Z", "endDate": "2019-12-21T06:12:00.000Z", "completeDate": "2019-12-22T03:07:15.802Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "431055", "author": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "body": "Here is a trace log of our Android build taking ~4 minutes to run. https://gist.github.com/btknorr/f92cec0d658b6985c2e8151d07230ac1", "updateAuthor": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "created": "2017-11-20T20:28:07.000+0000", "updated": "2017-11-20T20:28:07.000+0000" }, { "id": "436834", "author": { "name": "zettageek", "key": "zettageek", "displayName": "Josh Lambert", "active": true, "timeZone": "America/Chicago" }, "body": "I've seen the issues on this ticket also -- especially the Dexer step. Localytics JAR from this module is a big offender:\r\nhttps://github.com/centrevilletech/localytics-hyperloop", "updateAuthor": { "name": "zettageek", "key": "zettageek", "displayName": "Josh Lambert", "active": true, "timeZone": "America/Chicago" }, "created": "2018-04-12T16:10:07.000+0000", "updated": "2018-04-12T16:10:07.000+0000" }, { "id": "442573", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Was digging around in the _build.js and I found that this line:\r\n{code:java}\r\nif (!this.forceRebuild && fs.existsSync(this.buildBinClassesDex)) {\r\n\t\treturn next();\r\n}\r\n{code}\r\nto skip the dexer. But it is never called in my tests since forceRebuild is true for different reasons:\r\n\r\n{noformat}\r\nForcing rebuild: JavaScript encryption flag changed\r\n Was: undefined\r\n Now: false\r\n{noformat}\r\n\r\n\r\nor \r\n\r\n\r\n{noformat}\r\nForcing rebuild: /test_alloy/build/android/build-manifest.json does not exist\r\n{noformat}\r\n\r\n\r\nStill when I just call next() instead of checking it (2nd compiler run) the app compiles fine and I get a running APK with changes to XML/JS files. Speed improvement was about 20sec! Would be nice to fix that.", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-10-12T21:09:37.000+0000", "updated": "2018-10-12T21:09:37.000+0000" }, { "id": "453275", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nPR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-20T23:57:50.000+0000", "updated": "2019-12-20T23:57:50.000+0000" }, { "id": "453635", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket, Improvement verified in SDK Version {{9.0.0.v20200109153329}}.\r\n\r\nTest and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile/pull/11339", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-10T15:19:15.000+0000", "updated": "2020-01-10T15:19:15.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }