ExchangeCalendar / exchangecalendar

Exchange Calendar, Tasks, Contacts provider for Mozilla Thunderbird
GNU General Public License v3.0
677 stars 58 forks source link

Improve contact auto complete search results #223

Closed Trim closed 5 years ago

Trim commented 5 years ago

I had some fun on auto complete feature rewrite :)

IIRC, the auto complete address book search was not very fast, that's why I started to rewrite it.

The rewrite main goal was to get ride of loops inside this code as it could be a big cost if there's many contacts in the result set.

To do that, I need to have two lists:

  1. A list containing all Contacts (Cards) with organization by key which is their localid
  2. A list ordered by key which contains localid at the right position

So we can be very fast to find Cards either by giving us another instance of the same card by looking in the first list. We are also fast when we ask us about details with indexes as we first search the localid directly in the second list.

I took opportunity too to:

advancingu commented 5 years ago

The rest I will have to look at when I have more time.

advancingu commented 5 years ago

My comments here need to be taken in context of your earlier replies.

Trim commented 5 years ago

Thanks for your answers, I've added the commits to improve that branch.

advancingu commented 5 years ago

Thank you very much once again @Trim!