{ "id": "175552", "key": "ALOY-1740", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2020-09-19T17:13:16.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-09-27T16:00:21.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "*Issue details:*\r\nThis issue is about app build times having widgets and categorized in below two scenarios:\r\n# widgets having their assets/lib files inside the widget itself into respective folders.\r\n# widgets having their assets/lib files inside the main app's assets/lib folders.\r\n\r\n*Scenario 1:*\r\n- The build times are directly proportional to the number of controllers because all *assets/lib* files are copied for every single controller into the same destination folder.\r\n- e.g. if we have *100 assets* + *100 lib* files (in widget itself) for a widget with *100 controllers*, then all 100 assets + 100 lib files will be copied *100 times* (means for each controller) into the same destination *\"Resources/…\"*.\r\n- This even gets worse for the apps having many widgets with hundreds of controllers.\r\n\r\n*Scenario 2:*\r\n- The build times are not impacted in this case & are fine as expected.\r\n- e.g. if we have 100 assets + 100 lib files (in main app folder) for a widget with 100 controllers, then all 100 assets + 100 lib files will be copied *only once* into the destination \"Resources/…\".\r\n- This is how actually the build process should be.\r\n\r\n----\r\n\r\n*How we observed this issue:*\r\n- We have been recently working on an app improvements which have more than 20 widgets and each widget have approx 50+ controllers with 200+ assets & 6+ lib files. The app also has tons of main controllers, and in total the app has 600+ controllers & 3000+ assets & 150+ lib files.\r\n- This was noticed when we used to have very higher build times as usual and one day we observed something weird on console while building the app.\r\n- Earlier, we used to have build times of over *~ 10-15 mins* on decent MacBook Pro, but after following the below strategies, we were able to pull it down to *~ 2 mins*.\r\n\r\n----\r\n\r\n*Strategy we followed to work-around this issue:*\r\n- We moved all assets/lib files of each widget into the main app assets/lib folders after creating the separate folders for each widget.\r\n- We used same naming convention as WPATH uses internally for each widget, so we were able to replace all WPATH usages with the folder names we kept in above steps without any regression issues at all, and this is working fine as expected.\r\n\r\n----\r\n\r\n*Additional note on this issue:*\r\n- Even if any widget contains a hidden *.DS_Store* file inside its assets or lib folders, the build times will be affected in same as described in *Scenario 1*. So this hidden .DS_Store file should not be copied while building the app.\r\n- Because the hidden .DS_Store file is created unknowingly and hardly noticed during build process.\r\n\r\n----\r\n\r\n*Attached files details to reproduce this issue:*\r\n- There are 3 type of files each for above two scenarios - *.txt, .zip, .mp4*\r\n- *app-1.txt*: contains build logs where you can very easily see how the assets/libs files were copied 100 times for every widget controller. This build process took around *17 seconds* to compile.\r\n- *app-2.txt*: contains build logs where we moved all of the assets/lib files of the widget inside the main app assets/lib folders. This process took just *4 seconds*.\r\n- *app-1.zip* and *app-2.zip* contains required code files (only app folder) for issue reproduction for both scenarios.\r\n- *video-1.mp4* and *video-2.mp4* are the video recordings of the consoles for both scenarios.\r\n\r\n_Hope the description and attachments covers all the required information to resolve this issue._", "attachment": [ { "id": "67562", "filename": "app-1.txt", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-19T17:11:46.000+0000", "size": 1802452, "mimeType": "text/plain" }, { "id": "67561", "filename": "app-1.zip", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-19T17:11:41.000+0000", "size": 701454, "mimeType": "application/zip" }, { "id": "67559", "filename": "app-2.txt", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-19T17:12:43.000+0000", "size": 83999, "mimeType": "text/plain" }, { "id": "67558", "filename": "app-2.zip", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-19T17:12:46.000+0000", "size": 693018, "mimeType": "application/zip" }, { "id": "67560", "filename": "video-1.mp4", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-19T17:12:20.000+0000", "size": 9180934, "mimeType": "video/mp4" }, { "id": "67557", "filename": "video-2.mp4", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-19T17:12:52.000+0000", "size": 1994259, "mimeType": "video/mp4" } ], "flagged": false, "summary": "Build times impact by assets & lib files in widget itself", "creator": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK: 9.1.0.GA\r\nAppc CLI: 8.1.1\r\nTi CLI: 5.2.5\r\nNodeJS: 10.13.0\r\nMacOS: 10.15.6", "comment": { "comments": [], "maxResults": 1, "total": 1, "startAt": 0 } } }