Contacts API: Remove unused indexes

RESOLVED FIXED in Firefox 21

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: gwagner, Assigned: gwagner)

Tracking

unspecified
mozilla21
x86
macOS
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(blocking-b2g:-, firefox19 wontfix, firefox20 wontfix, firefox21 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Currently a save call for a single contact takes around 600 - 1000 msec.
550 msec out of 600 takes the actual transaction to finish.
If we remove all indexes we get down to around 140 msec.
Assignee: nobody → anygregor
Posted patch patch (obsolete) — Splinter Review
Posted patch patchSplinter Review
Attachment #708209 - Attachment is obsolete: true
Attachment #708213 - Flags: review?(bent.mozilla)
Comment on attachment 708213 [details] [diff] [review]
patch

Review of attachment 708213 [details] [diff] [review]:
-----------------------------------------------------------------

Yay!

::: dom/base/IndexedDBHelper.jsm
@@ +58,5 @@
>      };
>  
>      req.onupgradeneeded = function (aEvent) {
> +      if (DEBUG) debug("Database needs upgrade:" + self.dbName + aEvent.oldVersion + aEvent.newVersion);
> +      if (DEBUG) debug("Correct new database version:" + aEvent.newVersion == this.dbVersion);

Nit: Combine in one DEBUG check

::: dom/contacts/fallback/ContactDB.jsm
@@ +53,1 @@
>          objectStore.createIndex("familyName", "properties.familyName", { unique: false, multiEntry: true });

You know, while you're here... :)

You could remove the 'unique: false' from all of these (that's the default). If you want to leave them it's ok too.

@@ -105,5 @@
>          if (!objectStore) {
>            objectStore = aTransaction.objectStore(STORE_NAME);
>          }
> -        // Delete old email index.
> -        objectStore.deleteIndex("email");

Hm, I think you should leave this, since if the email index does exist you're going to do a bunch of work below that will cause the index to update itself.
Attachment #708213 - Flags: review?(bent.mozilla) → review+
blocking-b2g: --- → tef?
Comment on attachment 708213 [details] [diff] [review]
patch

[Triage Comment]
Let's not block the release on this but let's take this.
Attachment #708213 - Flags: approval-mozilla-b2g18+
Blocks: 819091
blocking-b2g: tef? → -
https://hg.mozilla.org/mozilla-central/rev/aba3331a5c54
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Batch edit: Bugs fixed on b2g18 after 1/25 merge to v1.0 branch are fixed on v1.0.1 branch.
You need to log in before you can comment on or make changes to this bug.