{ "id": "171821", "key": "TIMOB-26145", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2018-06-28T06:41:37.000+0000", "created": "2018-06-21T04:15:49.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "performance" ], "versions": [ { "id": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "issuelinks": [ { "id": "56631", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "171820", "key": "TIMOB-26144", "fields": { "summary": "Android: Improve File.getDirectoryListing() performance in Resources directory", "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": "Low", "id": "4" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-29T05:36:19.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "*Summary:*\r\nOn Windows, accessing files/directories under \"Resources\" is slower than it should be. These files are stored within the APPX where a list of file paths from \"assets\" can be easily extracted... which should make it faster than storage access.\r\n\r\n*Test:*\r\nRun the below code to fetch a listing of all files under the \"Resources\" directory. Observe the log for the duration of this function.\r\n{code:javascript}\r\nvar startTime = new Date();\r\nvar file = Ti.Filesystem.getFile(Ti.Filesystem.getResourcesDirectory());\r\nvar listing = file.getDirectoryListing();\r\nTi.API.info(\"@@@ getDirectoryListing() duration: \" + (new Date() - startTime));\r\n{code}\r\n\r\n*Recommended Solution:*\r\nAn Windows APPX is really a zip file. We should open the APPX as a zip file and fetch/store all zip entries referencing files under the \"assets\" directory. This way we can have fast hash table lookups when doing existence checks and fetching directory listings.\r\n", "attachment": [], "flagged": false, "summary": "Windows: Improve File.getDirectoryListing() performance in Resources directory", "creator": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1045, "state": "closed", "name": "2018 Sprint 13 SDK", "startDate": "2018-06-17T20:47:13.621Z", "endDate": "2018-07-01T20:47:00.000Z", "completeDate": "2018-07-02T18:40:05.029Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "438797", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid, I observed the symptom completely wrong. There should be no difference between reading resource directory and other directory because all contents in appx end up extracted into normal directory so technically there's no need to \"unzip\" it.", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-06-28T06:41:37.000+0000", "updated": "2018-06-28T06:41:37.000+0000" }, { "id": "438839", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "That's sounds about right. A Windows Phone Silverlight XAP app is unzipped as well. So, I wouldn't be surprised if APPX worked the same way.\r\n\r\nBut this should mean {{getDirectoryListing()}} performance should be roughly the same between the \"Resources\" directory and any other directory on storage, right? The only major difference is that we should be listing the encrypted JS files under \"Resources\" as well and merging that list with what we've grabbed from storage.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-28T21:24:46.000+0000", "updated": "2018-06-28T21:24:46.000+0000" }, { "id": "438856", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Yes, getDirectoryListing performance should be roughly same. One interesting thing is that applications are stored in restricted folder called {{WindowsApps}} to isolate the app onto sandbox (I guess) so it may be slightly affecting to the performance but it should be very small.", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-06-29T05:36:19.000+0000", "updated": "2018-06-29T05:36:19.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }