{ "id": "63672", "key": "TIMOB-3040", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11247", "name": "Sprint 2011-12", "archived": true, "released": true, "releaseDate": "2011-03-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-05T15:21:15.000+0000", "created": "2011-04-15T03:35:18.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "defect", "release-1.7.0", "reported-1.5.1" ], "versions": [], "issuelinks": [ { "id": "10243", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "64773", "key": "TIMOB-3703", "fields": { "summary": "Confirm TIMOB-3040", "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": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } } ], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-05-05T15:21:15.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": "{html}

\"Failcase\" is, for example, the Table View Layout 2 test in\nKitchenSink. It's not really a \"failure\" since the test actually\nworks. But behind the scenes a bunch of exceptions -- handled\nexceptions -- are happening, very likely affecting performance.

\n

You can see it happening if you run KS with <property\ntype=\"bool\" name=\"ti.android.debug\">true</property>\nin tiapp.xml. Run adb logcat at the command line, then\n-- with KS running in your emulator -- go to the Views -> Table\nViews -> Layout 2 test. As the test loads, watch logcat\nscrolling by -- you'll end up seeing a ton of exceptions. If you\nthen scroll up and down on the table view in the test, you'll see a\nton more exceptions being logged in logcat.

\n

Alternatively, you can watch me doing it here:

\n

http://screencast.com/t/FD9E6klYe

\n

What's happening is this: Because the image path begins with\nResources/images -- which is one of our standard locations to check\nfor density-specific images -- we do the density image name\nmangling and check to see if the image exists as an Android\nresource. The checking to see if it's a resource uses reflection\n(see TiRHelper.locateResource), and has to accept the\nfact that an exception will be raised if the resource doesn't\nexist. It handles that fine (and sends it to logcat if debug is\nturned on -- which is what we're seeing in that video) and the\nresult is that our loadDrawable method ends up\nsuccessfully finding the image file in the standard file system.\nBut I imagine those exceptions are expensive. The problem is that\n-- unlike successful finds of a resource image -- we do\nnot cache the failures. So it tries every\ntime to load the same image as a resource that doesn't\nexist.

\n

I think putting images into the Resources/images folder is\nprobably a fairly common pattern for app developers. So we could\nperhaps improvement performance for these people by caching\nresource lookup failures to avoid going through the series of\nexceptions over and over again.

{html}", "attachment": [], "flagged": false, "summary": "Android: If image stored directly in Resources/images, referencing it causes too many unnecessary exceptions", "creator": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "129923", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [b47d085bb43a5bc9b885ee89d7067eddccbbc8db])\nWhen looking up Resource/android/images/xxx images in the android\nresources, don't bother checking for android system resources,\nsince by definition you're looking for a project-specific resource.\nSaves one lookup. [#3040] \nhttps://github.com/appcelerator/titanium_mobile/commit/b47d085bb43a...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:35:20.000+0000", "updated": "2011-04-15T03:35:20.000+0000" }, { "id": "129924", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Hmm, as usual one of my commits not listed automatically. The\nmain commit for this item is:

\n

\nhttps://github.com/appcelerator/titanium_mobile/commit/e7beec84f520...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:35:21.000+0000", "updated": "2011-04-15T03:35:21.000+0000" }, { "id": "129925", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

QE Testing: follow the elaborate :) instructions up in the\ndescription, and (in the pre-fix version of the SDK) you'll see a\nbunch of exceptions scrolling by in logcat (they will be\ncategorized as \"TiRHelper\"). Then, after installing the fixed\nversion, you won't see those exceptions anymore.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:35:21.000+0000", "updated": "2011-04-15T03:35:21.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }