Closed
Bug 909454
Opened 11 years ago
Closed 9 years ago
Allow filters for mozContacts.getAll
Categories
(Core Graveyard :: DOM: Contacts, defect, P3)
Tracking
(tracking-b2g:backlog)
RESOLVED
INVALID
tracking-b2g | backlog |
People
(Reporter: kgrandon, Unassigned)
References
Details
(Keywords: perf, Whiteboard: [c= p= s= u=])
Currently filters are only used for find() calls. We would really like to see filters for mozContacts.getAll for some performance investigation. This bug to see if it's possible and how much work that it would take to implement. For example, we are trying to make a call like:
navigator.mozContacts.getAll({
sortBy: 'givenName',
sortOrder: 'descending',
filterBy: ['familyName'],
filterValue: 'Z',
filterOp: 'startsWith'
});
Reporter | ||
Comment 1•11 years ago
|
||
Gregor - if you have any tips about where to get started with this it would be helpful. I might have someone on our team try to tackle this if you are busy. Thanks!
Flags: needinfo?(anygregor)
Updated•11 years ago
|
Component: Gaia::Contacts → DOM: Device Interfaces
Product: Boot2Gecko → Core
Comment 2•11 years ago
|
||
Kevin and I were looking at the code it appears this might work if we change nsIDOMContactManager.idl so that getAll() uses nsIContactFindOptions.
This should allow the filter options to pass to getAll(), which will be applied during the non-cached query.
Kevin just verified that this works in a modified firefox nightly and the simulator.
One potential issue would be if we get too many cached results that never get cleaned up.
Thoughts?
Comment 3•11 years ago
|
||
We should just limit the number of cache-entries and overwrite old values. Otherwise it should just work.
Flags: needinfo?(anygregor)
Comment 4•11 years ago
|
||
So you want find() with cursors? That should be simple, yes. Caching results keyed on the find options is going to be pretty much useless, though.
Comment 5•11 years ago
|
||
(In reply to Reuben Morais [:reuben] from comment #4)
> So you want find() with cursors? That should be simple, yes. Caching results
> keyed on the find options is going to be pretty much useless, though.
Well, our thought was to all filtering options in getAll() instead of adding cursors to find(). The caching was only mentioned since getAll() does caching.
Comment 6•11 years ago
|
||
Sorry, to *add* filtering options to getAll().
Comment 7•11 years ago
|
||
(In reply to Ben Kelly [:bkelly] from comment #5)
> Well, our thought was to all filtering options in getAll() instead of adding
> cursors to find(). The caching was only mentioned since getAll() does
> caching.
Without mentioning the obvious problem of appropriate naming, I don't like the idea of getAll having two very different (speed and memory usage) behaviors depending on what options are passed.
Updated•11 years ago
|
Component: DOM: Device Interfaces → DOM: Contacts
Updated•11 years ago
|
blocking-b2g: --- → backlog
Priority: -- → P3
Assignee | ||
Updated•10 years ago
|
blocking-b2g: backlog → ---
tracking-b2g:
--- → backlog
Reporter | ||
Comment 8•9 years ago
|
||
I think that this bug is no longer valid with the transition plan. Please re-open if you think we should still do this.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•