Contact Lookup Performance Revisted
It’s been over a year since we last looked at performance, so we thought we’d revisit it.
Comparing Pro and Fast
This time round, we were interested in seeing how many contacts we could load into Android before it started to get too sluggish. Our test phone was the Samsung Galaxy Nexus, the Google phone running OS4.0.2 It’s a competent phone with enough memory to load a large number of contacts. By comparison, the HTC Desire we used last year choked when we put more than 10000 contacts into one of the test Gmail accounts. The Desire simply ran out of internal memory.
Our starting point was with around 10000 contacts and we loaded contacts in 2500 increments up to 25000. The Nexus could probably take more, but it would be a limited number of users with more contacts than this, we think. Also, each Gmail account is supposed to have a limit of 25000 contacts, so going further might be pointless.
We ran two searches one for Jon and one for 1966. The idea of doing a number search is to see what impact this has on the search time. Both Pro and Fast have algorithms to determine if the search query is a number and perform some explicit phone number lookups.
From the results, this has little impact on the search times.
So, Contact Lookup Fast can search 25000 records in under a second. Contact Lookup Pro isn’t too shabby at just over 7 seconds.
There’s an obvious linear relationship between the search time and the number of searches which indicates that we’re not suffering from adverse Java garbage collection or other memory limitations.
A feature of both Pro and Fast is that they allow you to perform complicated queries against your data. You can enter multiple search terms and look for contacts that match any term (OR mode) or only contacts that match all terms (AND mode). Test Two used an AND mode search to see what the impact of this would be with large numbers of contacts.
With the simple search in Test One, we rely mostly on the database to perform the core of the work. With Test Two, we also have to implement some complicated algorithms to whittle down the search candidates. AND mode makes things worse as we initially have a larger pool of candidates to search in.
From the graph we can see the superior performance of Fast when performing these more complicated queries. When searching 25000 contacts it can take Pro over a minute to find the contacts, whereas Fast truly lives up to its name and returns results in under a second.
In the Real World
So how do Pro and Fast perform in the real world against some of the other Contact Manager applications? To test this, we ran some real world tests with 25000 contacts and compared them so some of the popular contact applications on the Market. You can read more about these other applications in the feature comparison.
The graph shows two searches. The first is a repeat of the simple search for Jon. Fast is significantly faster than any of the other applications and Pro is comparable, even though it searches all the available fields and labels.
The second search compares the time it takes to start the application, type a four letter search term and wait for the results. Each application was booted out of memory before running the test, so there should have been no caching to speed things up. Again, Fast is the clear winner with half of it’s 8 second query time taken up with typing the search query. Pro performs slightly better against the competition, mainly due to the fact that the other applications start to load up the list of contacts when opened. With a large number of contacts, this is not particularly useful and you are more likely to need to search.
The test was repeated again for each application, without clearing the application from memory. All applications were almost twice as fast this time round.
A few Notes on the Competition
We were mildly surprised to see how well the competition handled this number of contacts, given that they are not dedicated search tools. For more casual users, they are adequate search tools with some very nice UI design and integration with phone and SMS.
Z Contacts works well and supports some Palm like initial and surname searching. The lack of a button to clear the search window is the only real feature it lacks.
Contapps, too, works well, but lacks comprehensive search, being the least featured of all the applications tested.
Go Contacts is good, but is let down by a search that starts the moment you type. This may be OK for a few thousand contacts, but results in sluggish performance when you have tens of thousands. A simple tweak to the UI to wait for 300ms to allow you to type more data would improve the responsiveness of this application.
Contact Lookup Fast is by far the fastest search tool to query all of the categories in the contact database. It does have some limitations in the need to build it’s own index, but these are the price to pay for speed.
Generally Android copes well with 25000 contacts. The OS had no problems at all, but there are issues with reduced battery life due to the requirements to sync that much data and the general CPU grunt needed to search. Some applications, like Swype, are unusable with a large number of contacts. Swype’s problem is that it parses the contact database to build up it’s own dictionary of words you use and this just kills it.
The graphs below show how much time it takes to build the index and how much memory is required to store the index. Note that the time to build the index may be significantly longer on lower spec devices, either ones with a slower CPU or with less available memory. Like our HTC device, some users will not be able to run Fast with a large number of contacts, as the overheads to build the index may be too large.