One thing about MacEmbed that makes it fast is that it is piggish with
the CPU. It always calls WaitNextEvent() with a sleep time of 0. This is
because the message pump in this app is not meant to be re-used. An
embedding app will always have that to begin with. So I made the sleep
time calculation simple (non-existant) which may boost performance. I'll
copy the sleep time calculation logic from Mac mozilla and see how it
compares.
-Conrad
Mike Pinkerton wrote:
> Just doing some _very_ cursory testing, it appears that the macEmbed
> harness (a powerplant app that embeds mozilla) is faster at layout out
> pages than mozilla navigator. Here's what I see with two equivalent
> debug builds (same tree):
>
> - first, I commented out the throbber in macEmbed, which is an animated
> gif using ImageLib. In macEmbed, loading cnn.com locks the machine for 3
> seconds (this is a debug build) but then the entire page displays in one
> shot -- images and all. At this point it's done.
>
> - with mozilla, it locks up for the same 3 seconds, but what displays is
> just the webpage text, the images have yet to load. The images then
> trickle in over the next 5 seconds.
>
> - then i put the throbber back into macEmbed, and the images all loaded
> more slowly (they weren't there at the initial blit of the page, but
> finished loading more quickly).
>
> Why are images loading so slowly? It seems that animated gifs of any
> kind _really_ hurt our performance, especially page loads.