Optimize T9Search performance / memory consumption
This change optimizes the T9Search feature in two ways: 1. Memory consumption The original Contacts app actually crashed on my Vision with an Out of Memory Error, until I increased the Heap Size to 48M It was set to 32M before, and I cannot remember changing it before so I guess, 32M is the default for Vision. Now it works flawlessly with 32M again, mainly because it does not read each and every contact's photo into RAM prior to searching, but reads contact photos on demand/display. 2. Speed The photo-reading task was not only memory- but also time-consuming, and while doing so, the search just did not work. I always had to wait a few seconds before typing in any number, else the search yielded no results. In addition to this I rewrote the name-to-number conversion. This should also help speed-wise (yet not as much as the photo reading). Actually the result is still no piece of art, but works how I expected it to be -- I can hit the keys immediately after opening the Contacts app, it immediately shows the correct results and it does not crash with an OOM, even with a 32M heap size and ~400 contacts. So this might actually fix #4922 as well. http://code.google.com/p/cyanogenmod/issues/detail?id=4922 Change-Id: I90858354c7a718fe311a5e4f585a19a2972acc95
Loading
Please register or sign in to comment