There have been a few notes in the reviews on the App Store about search times in DianHua Dictionary. One review noted that a search for "Football" and even "American Football" took far too long. On the recently released v1.3.2, a search for "football" on my 1st generation iPhone took just a little over 1 second. A search for "American Football" was nearly immediate. Using a previous version, it would not surprise me in the least to see the same search take 3-5 seconds for "Football" and considerably longer for "American Football". The main point is that I'm constantly working on improving performance.
The interesting thing I discovered in developing v1.3.2 is that there is a distinct difference between achieving a performance gain in a test environment versus what happens in the native iPhone environment. To further explain, I changed the English and Pinyin indexing along with the search queries for v1.3.2. In testing those changes on my development Mac, I achieved dramatic performance improvements on most queries, registering gains in the 70-80% range on many of my tests. When I tested the new indexing and queries on an iPod touch, the improvements were much less pronounced. By some crude measurements, the gains were little better than 10-20% in most cases.
The other issues at work in further performance improvements is that there is always a trade-off. It probably hasn't gone unnoticed that each release of DianHua Dictionary has nearly doubled in size. The more I do to index and arrange the data to increase search speed, the more space that data will consume.
As for v1.3.2, here are some hints for improving search speed:
- If you are searching for a verb in English, search for the infinitive. So instead of searching for "eat", search for "to eat". This will help the query hit on an exact match instead of a near match.
- In general, the more information you provide, the faster the search will run. This is especially important with Pinyin. Instead of searching for "hao3", you would be better off searching for "ni3 hao3" or "hen3 hao3".
- If you are searching in Pinyin, include the tone numbers. The Pinyin data is not indexed well for toneless searching, and the searches will take almost double the amount of time as they would if they included tones.
- Simplified and Traditional character searches are slow, but the more characters you provide, the faster they will run.
I'm still considering switching the default search results to an exact match on all searches, but I'm hesitant to do this because I know in my own use I rarely want an exact search. However, I am open to suggestions.
If you have any criticisms or recommendations for DianHua Dictionary, please feel free to contact me through comments on the blog or support inquiries on the site.