Closed
Bug 403256
Opened 19 years ago
Closed 18 years ago
Make nsIAddressBook a service and keep the root rdf address book alive.
Categories
(MailNews Core :: Address Book, defect, P3)
MailNews Core
Address Book
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.9.1a2
People
(Reporter: standard8, Assigned: standard8)
References
Details
(Keywords: perf)
Attachments
(6 files, 3 obsolete files)
|
40.80 KB,
patch
|
standard8
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
|
28.89 KB,
patch
|
neil
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
|
286 bytes,
patch
|
neil
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
|
4.40 KB,
patch
|
neil
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
|
3.23 KB,
patch
|
Bienvenu
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
|
1.93 KB,
patch
|
Details | Diff | Splinter Review |
Bug 379828 comment 62 has highlighted that if we don't keep a reference to the root rdf address book (moz-abdirectory://) alive, then every time we want to access it or the other directories, we're loading them all in and re-initialising them from scratch.
Obviously re-initialising them from scratch is expensive (see http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/mailnews/addrbook/src/nsAbBSDirectory.cpp&rev=1.40&mark=134-186#132
for where it starts).
For the moment, we're getting around this by storing a cache in nsMsgContentPolicy, we should really do this in nsIAddressBook with nsIAddressBook being a service (currently we create a new instance of it each time.
I think this may slow down start-up time slightly (or first access), but would give us a big advantage over our current speed issues.
For this to happen, we need to drop its inheritance of nsIContentHandler and nsIStreamLoaderObserver (which access it via createInstance) which means moving that code elsewhere - possibly to a js component.
| Assignee | ||
Comment 1•18 years ago
|
||
This changes nsIAddressBook into a service.
I think I've got all the calls changed - I'm going to check tomorrow on mxr, assuming I have, then I'll request review.
| Assignee | ||
Comment 2•18 years ago
|
||
This patch includes a couple of changes in mailnews/addrbook/prefs that I'd previously missed.
I'm happy I've got all the changes. Interestingly palm sync already gets nsIAddressBook as a service...
Note that the content handler code, I've just moved straight out into its own class (so that it can be called safely via createInstance), and re-organised the includes in nsAddressBook as a result.
Although moving content handler out does give us some losses in terms of code size etc, I'm hoping to gain that back real soon by merging nsIAddrBookSession into nsIAddressBook. nsIAddrBookSession is an already existing service that deals with address book level notifications etc, so it seems to make sense to merge them together - I'll cover that in a separate bug though.
Attachment #290151 -
Attachment is obsolete: true
Attachment #290224 -
Flags: review?(neil)
Comment 3•18 years ago
|
||
Comment on attachment 290224 [details] [diff] [review]
The fix v2
>-[scriptable, uuid(0823e46e-8802-42d5-b91b-7e4816c8d2f0)]
>+[scriptable, uuid(bf83d970-1697-40ad-aad1-3b0606957c32)]
I suppose this change is to alert people to use it as a service?
> nsAbLDIFService.cpp \
>+ nsAbContentHandler.cpp \
> $(NULL)
Heh, funky indentation here ;-)
>+#define EXPORT_ATTRIBUTES_TABLE_COUNT 51
Can we change this to an NS_ARRAY_LENGTH?
>+ addressbook = Components.classes["@mozilla.org/addressbook;1"]
>+ .getService(Components.interfaces.nsIAddressBook);
When you're reindenting these is it possible to line them up like this?
addressbook = Components.classes["@mozilla.org/addressbook;1"]
.getService(Components.interfaces.nsIAddressBook);
Attachment #290224 -
Flags: review?(neil) → review+
| Assignee | ||
Comment 4•18 years ago
|
||
Addressed Neil's comments, carrying forward his r, requesting sr.
Attachment #290224 -
Attachment is obsolete: true
Attachment #290422 -
Flags: superreview?(mscott)
Attachment #290422 -
Flags: review+
| Assignee | ||
Comment 5•18 years ago
|
||
Comment on attachment 290422 [details] [diff] [review]
The fix v3 (checked in)
Switching sr request to David as I'd like to move this on a bit.
Attachment #290422 -
Flags: superreview?(mscott) → superreview?(bienvenu)
Comment 6•18 years ago
|
||
Comment on attachment 290422 [details] [diff] [review]
The fix v3 (checked in)
Maybe this isn't possible for compatibility reasons, but it sure would be nice to have a different name, like nsIAddressBookMgr or Service - as it is now, the code still reads like we're creating an address book instance and will continue to confuse folks.
Attachment #290422 -
Flags: superreview?(bienvenu) → superreview+
| Assignee | ||
Comment 7•18 years ago
|
||
Comment on attachment 290422 [details] [diff] [review]
The fix v3 (checked in)
Checked in, I also backed out a printf that shouldn't have been there.
Attachment #290422 -
Attachment description: The fix v3 → The fix v3 (checked in)
| Assignee | ||
Comment 8•18 years ago
|
||
David suggested renaming nsIAddressBook so it more accurately reflects what we are doing (i.e. a manager or service). We had a quick chat on irc and I think we settled on nsIAbManager.
So here's the code that'll do the change. In the first instance, I'm just doing search & replace (based on my previous patch) - once we've got the change checked in, then I'll arrange a separate patch for sorting out cvs copies & renaming the ns?AddressBook* files.
Attachment #292239 -
Flags: superreview?(bienvenu)
Attachment #292239 -
Flags: review?(neil)
Comment 9•18 years ago
|
||
Comment on attachment 292239 [details] [diff] [review]
Rename nsIAddressBook to nsIAbManager (checked in)
>- nsAddressBook::RegisterProc,
>- nsAddressBook::UnregisterProc },
>+ nsAbManager::RegisterProc,
>+ nsAbManager::UnregisterProc },
These are obsolete (see attachment 275769 [details] [diff] [review]) r=me with them removed.
Attachment #292239 -
Flags: review?(neil) → review+
| Assignee | ||
Comment 10•18 years ago
|
||
cvs moves file to rename nsAddressBook.{h,cpp} to nsAbMananger.{h,cpp}. I think we need this to save confusion.
I'll attach the final build changes once the main rename patch is approved & checked in.
Attachment #292654 -
Flags: superreview?(bienvenu)
Attachment #292654 -
Flags: review?(neil)
Comment 11•18 years ago
|
||
Comment on attachment 292654 [details] [diff] [review]
cvs moves for nsAddressBook to nsAbManager
What about nsIAddressBook -> nsIAbManager?
| Assignee | ||
Comment 12•18 years ago
|
||
(In reply to comment #11)
> (From update of attachment 292654 [details] [diff] [review])
> What about nsIAddressBook -> nsIAbManager?
>
I knew I forgot something.
| Assignee | ||
Updated•18 years ago
|
Attachment #292654 -
Attachment is obsolete: true
Attachment #292654 -
Flags: superreview?(bienvenu)
Attachment #292654 -
Flags: review?(neil)
| Assignee | ||
Comment 13•18 years ago
|
||
Include the interface file as well this time... As before I'll do the final patch to do the build changes for the move once the first patch is approved & checked in (as its easier ;-) ).
Attachment #292799 -
Flags: superreview?(bienvenu)
Attachment #292799 -
Flags: review?(neil)
Updated•18 years ago
|
Attachment #292799 -
Flags: review?(neil) → review+
Comment 14•18 years ago
|
||
Comment on attachment 292239 [details] [diff] [review]
Rename nsIAddressBook to nsIAbManager (checked in)
thx a lot for doing this, Mark.
Attachment #292239 -
Flags: superreview?(bienvenu) → superreview+
Updated•18 years ago
|
Attachment #292799 -
Flags: superreview?(bienvenu) → superreview+
| Assignee | ||
Updated•18 years ago
|
Attachment #292239 -
Attachment description: Rename nsIAddressBook to nsIAbManager → Rename nsIAddressBook to nsIAbManager (checked in)
| Assignee | ||
Comment 15•18 years ago
|
||
I think only one person needs to look at this.
Attachment #293002 -
Flags: superreview?(neil)
Attachment #293002 -
Flags: review?(neil)
Updated•18 years ago
|
Attachment #293002 -
Flags: superreview?(neil)
Attachment #293002 -
Flags: superreview+
Attachment #293002 -
Flags: review?(neil)
Attachment #293002 -
Flags: review+
| Assignee | ||
Updated•18 years ago
|
Attachment #293002 -
Attachment description: Change file inclusion for nsIAbManager after the cvs copies/moves. → Change file inclusion for nsIAbManager after the cvs copies/moves (checked in)
| Assignee | ||
Updated•18 years ago
|
Priority: -- → P3
Updated•18 years ago
|
Product: Core → MailNews Core
| Assignee | ||
Comment 16•18 years ago
|
||
Bug 449618 will be removing the cache we added in in bug 379828 for the top-level address book (so that the rdf service didn't keep dropping & re-initialising the directories).
Therefore I need to get round to fixing this bug ;-)
I have just been doing some testing. Opening up (and keeping) an address book with 5000 full entries in it expanded the memory in use ("Real Memory" as Mac OS X calls it) by approx 6MB. The mork file is about 3.3MB.
However, it should be noted that if you disable the current cache that we have in bug 379828, then what happens on current trunk is as follows:
* If in TB, when you select a message, the personal address book gets cached and stays like it until you shut down (this is in the header processing code, where we are working out whether or not to show the display name).
* In either SM/TB when you go into the address book and select a directory (or the sidebar) it is opened and cached.
I therefore don't think its too much of a "regression" that we are caching the directories, as we do a lot of that already. Additionally, on trunk with the changes in bug 379828 we would have been doing that anyway.
So I think it is reasonable to cache it in nsAbManager, obviously when we implement sqlite or remove RDF from the address book completely, it will be something to think about a bit more.
Attachment #333919 -
Flags: superreview?(bienvenu)
Attachment #333919 -
Flags: review?(bienvenu)
| Assignee | ||
Comment 17•18 years ago
|
||
Updated•18 years ago
|
Attachment #333919 -
Flags: superreview?(bienvenu)
Attachment #333919 -
Flags: superreview+
Attachment #333919 -
Flags: review?(bienvenu)
Attachment #333919 -
Flags: review+
| Assignee | ||
Comment 18•18 years ago
|
||
Comment on attachment 333920 [details] [diff] [review]
[checked in] Cache the top-level address book in the manager
Checked in changeset id: 106:f46fea54c2d5
Attachment #333920 -
Attachment description: Cache the top-level address book in the manager → [checked in] Cache the top-level address book in the manager
Comment 20•18 years ago
|
||
(In reply to comment #19)
> This is fixed now.
Means we can also set the status to fixed?
| Assignee | ||
Updated•18 years ago
|
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•