JSQ, LLC

Mobile and Web Applications

  • Increase font size
  • Default font size
  • Decrease font size
Home Blog General Dictionary Search Performance

Dictionary Search Performance

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:

  1. 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.
  2. 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".
  3. 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.
  4. 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.

 

Comments
Add New Search
alex     |2008-11-07 13:53:28
Hi there. Thanks for the great work with Dianhua -- I was going to write my own
until I saw somebody who came out with one already! :) Thanks also for working
so much on performance -- that is probably my number one complaint. A few
thoughts...

Have you considered adding an extra search parameter for
"Begins with", "Ends with", "Exact Phrase" and
"Contains"? I would suspect this would return search results faster (I
am guessing you are using SQLite for this??).

Also, I haven't looked into this,
but have you tried Search Kit for the indexing? It would probably run faster
than a DB -- especially since Apple wrote it specifically for tasks like
this.

Thanks again!
Jason   |2008-11-08 01:08:48
Originally, I had considered using the search parameters you noted, but those
options rarely give me the information I want with online dictionaries when I
use them. They also clutter the interface a bit. If there's significant
demand, I would consider adding them as options, but for now, I'm reasonably
pleased with what I have.

I am still considering making exact search the
default. If no results are found, I would switch to the existing search, but if
a result is found, I would provide the option to do a more exhaustive
search.

DianHua does use sqlite for its database. Since I've never been a Mac
developer, I can't say as I was familiar with Search Kit. Unfortunately, it
doesn't appear that Search Kit is available on the iPhone.

Thanks for your
comment and for using DianHua Dictionary.
Eric  - Add dianhua dictionary on my ipod   |2008-11-23 12:47:55
Hello,
I have found your software great but I am unable to add it to my ipod as
itunes keeps asking me to register. And I do not have a credit card which makes
it impossible (even when I choose the option no credit card a got asked about
it) SO I wonder if there is anyway to get it appart from itunes?
Jason   |2008-11-25 20:25:31
Please send me a message through our support form including an e-mail address
where I can contact you.

Thanks,

Jason
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."