Closed Bug 13555 Opened 25 years ago Closed 25 years ago

Profile code opens and closes registry 20x at startup

Categories

(Core Graveyard :: Profile: BackEnd, defect, P1)

All
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: dveditz, Assigned: racham)

References

Details

(Whiteboard: [Perf])

The profile code opens and closes the registry 20x at startup. The registry is refcounted so if you make sure some outer thing keeps it open you may not have to change much code to fix this. When buffered i/o is added (soon) opening the registry will become even more expensive.
Assignee: selmer → racham
Blocks: 12696
Priority: P3 → P2
Target Milestone: M11
Status: NEW → ASSIGNED
I can open the registry in the startup and close it down again in the shutdown. That should let me remove all those additional open()s in the other sub-routines. Changing status to assigned.
Blocks: 7251
Adding to the list of startup performance bugs.
Whiteboard: [Perf]
Putting on [Perf] radar.
*** Bug 14002 has been marked as a duplicate of this bug. ***
We need to cache the curr profile dir value in the file locator service. All other components use file locator service to get this value. Also, at the start up, registry is opened and closed many times. Yesterday, Dan Vetidz has added an API to nsRegistry which tells whether a registry is opened or not. Using that API, we can cut down on the number of opens and closes at the startup.
nsIRegistry::IsOpen() was checked in last night -- use away!
Severity: major → critical
Priority: P2 → P1
Getting nsRegistry as a SERVICE is the wrong thing to do. Because nsRegistry keeps a handle to the open registry file we need a different instance of nsRegistry for each open registry. Create it as a component! Then we won't conflict with other users. Apparently this was a major flaw in the IsOpen() call I added -- you know *A* registry is open, but you don't know it's the one you want if you're using the registry service. If you use the component manager to create a new instance this won't be a problem.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Thanks to Dan and Steve. Profile registry is opened as a component not as a service. Used isOpen() API to minimize the number of I/O operations on mozregistry at startup. Registry now is opened in the Startup and is closed at the end of Startup operations.
Bhuvan, Is there a test case I can use to verify this? Grace
Grace, Do you know anyone who runs purify in QA ? Then we can measure the number of times registry is being accessed.
Component: Profile Manager → Profile Manager BackEnd
Moving all Profile Manager bugs to new Profile Manager Backend component. Profile Manager component to be deleted.
code fix
Status: RESOLVED → VERIFIED
No longer blocks: 7251
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.