Closed Bug 76865 Opened 23 years ago Closed 6 years ago

sServiceManager->GetService is an expensive call [perf]

Categories

(Core Graveyard :: Embedding: GTK Widget, defect, P3)

x86
FreeBSD
defect

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: pete, Assigned: pete)

Details

(Keywords: perf)

Attachments

(1 file)

In nsEmbedAPI.cpp 

sServiceManager->GetService is an expensive call. 
I guess this is another threading blocker issue. 
Once the chrome is registered this should not block.
There is a hiccup right at this call. 

This is a performance issue.

--pete
Keywords: perf
I am proposing this patch to give a speed boost to mozilla embedded.

These calls seem to not be needed. They are covered later on.

What this does is gives you a base window very quickly whicl everything is
registered in the background.

Try it out is works nice.

--pete
Now if i do:

$ ./run-mozilla.sh ./gtkEmbed

I get a base window up in under a second.

--pete
So now, perhaps if someone can beat some sense into me and tell me why this is
not a good thing. 

;-)

--pete
Adam, since you discovered the need to create the string bundle service on the
main thread, what were the symptoms of it *not* being created on the main
thread? Also, Pete, since you're doing this on Unix, is it possible that the
problem Adam found is not a problem for Unix but is for Windows?
FYI Some time stats:

0-1 sec: gtk window appears
1-5 sec: url www.mozdev.org is finished loading.

So i see a 5 second load time for that single web page.

If i use: Netscape® Communicator 4.73

I see the base window in just slightly over a second.
The url www.mozdev.org is loaded in under 2 seconds.

Granted, i am using a *debug* version of mozilla so . . .

--pete
Woha ..  `Mid Air Colision'  heh . . .
 
Conrad, maybe If Adam has a minute he can apply the patch on windows and see
what breaks. Does it work for you on mac?

--pete
The symptoms were that as soon as you made an HTTP request you got thread 
assertions everytime necko tried to access the string bundle to send you a 
notification string.

If everything works with the hack commented out, I think it is no longer 
needed. You could also remove the #define HACK_AROUND_THREADING_ISSUES at the 
top of the file too.
 
I notice that the patch also removes some chrome-registry code. I don't know why 
it is there, but it's possible that it's necessary to ensure newly added chrome 
is correctly registered.
get thee off the unconfirmed radar.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: patch
Ok, i see different behavior using embed that is built in the bin dir and using
embed in the dist/Embed dir. I do see some asserts if i run in dist/Embed.


--pete
I think that the call to CheckForNewChrome() should be in an ifdef DEBUG since
we should autoregister in that case.
Yea, things look pretty smooth until we get to here:

Source File: tests/gtkEmbed/main.cpp:
Function: OpenWebPage():
IMethod: webNav->LoadURI(NS_ConvertASCIItoUCS2(url).GetUnicode(),
nsIWebNavigation::LOAD_FLAGS_NONE);

--pete
Execution of LoadURI is fine.
It looks like this is the point that it can't fire off until the chromeRegistry
thread is finished it's auto reg.

So this particular perf choke is the chrome registration. 

(This is all being tested from dist/bin/gtkEmbed)

--pete
Over to pete since he's been working on it.
Assignee: blizzard → petejc
Marking for 0.9.5.

--pete
Target Milestone: --- → mozilla0.9.5
Status: NEW → ASSIGNED
pushing back
Target Milestone: mozilla0.9.5 → mozilla0.9.7
Priority: -- → P3
Target Milestone: mozilla0.9.7 → mozilla0.9.9
Target Milestone: mozilla0.9.9 → Future
QA Contact: pavlov → gtk-widget
Product: Core → Core Graveyard
Embedding: GTK Widget isn't a thing, closing.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: