News for hackers. Stuff that matters.
Re:20-line patch to Firefox 4 that makes startup on Windows ... by xpaulbettsx on Saturday January 22, 2011 @09:49PM (#2131642)
Hmmm, so I suspect in practice that you're not going to see this kind of difference usually - since he's probably testing on a binary he just built, SuperFetch (the built in OS prefetcher) hasn't had a chance to determine what pages are usually used by Firefox. Once you've used FF as your browser for awhile, SuperFetch will know better and won't do as badly.

That being said, this trick will probably beat SuperFetch, since they know up front that they'll be using big chunks of xul.dll. Don't do this in every app though, or else every app in the system is just chewing through IOs on pages they might not actually be using.

Re:20-line patch to Firefox 4 that makes startup on Windows ... by slightlyoff on Sunday January 23, 2011 @12:50AM (#2131882)
SuperFetch only hits the first 10 meg of a DLL. If any of these are larger than that, you'll still see significant thrashing on pages located further back in the binaries. I implemented a similar solution for chrome.dll last summer and it had a gigantic effect on cold start times. Glad to see Mozilla prioritizing startup too.
Re:20-line patch to Firefox 4 that makes startup on Windows ... by JonnieCache on Sunday January 23, 2011 @07:42AM (#2132320)
>SuperFetch only hits the first 10 meg of a DLL. If any of these are larger than that, you'll still see significant thrashing on pages located further back in the binaries

Yuck. Is there a good engineering reason for this reliance on the physical location of code within a lib file rather than its logical internal structure? I guess its a compromise they made after running some studies. Still seems sickeningly ugly though. Just like the trick the OP was forced to implement to override this behaviour.

Yucketty yuck yuck.

Re:20-line patch to Firefox 4 that makes startup on Windows ... by slightlyoff on Monday January 24, 2011 @03:29PM (#2136624)
Define "logical internal structure"? Most code in a library won't be differentiated by use unless you can provide WPO or PGO-based feedback that you trust as representative. As for the next obvious question ("why not just read in the whole thing?"), I think you can probably guess.

I'm not sure how yucky this is. The world is analog. MSFT made things go faster without asking developers to change anything they were doing. I wish more OSes showed more of this sort of user-centric, data-driven prioritization of feature development.

Re:20-line patch to Firefox 4 that makes startup on Windows ... by JonnieCache on Monday January 24, 2011 @05:43PM (#2137105)
I am clearly much less qualified to speak on this subject than you so I defer to you on this one.

All I meant by 'yuck' was that in my limited experience with computer science, whenever there is a solution that involves as blunt a compromise as 'cache the first 10 megabytes,' it isn't usually too long before that solution is known as the 'naive' solution.

Re:20-line patch to Firefox 4 that makes startup on Windows ... by asadotzler on Sunday January 23, 2011 @01:19AM (#2131927)
Alex, can you link the bug(s) or patch set for your similar changes?
Re:20-line patch to Firefox 4 that makes startup on Windows ... by mihaip on Monday January 24, 2011 @10:12AM (#2135328)
Re:20-line patch to Firefox 4 that makes startup on Windows ... by slightlyoff on Monday January 24, 2011 @08:57PM (#2137662)
Re:20-line patch to Firefox 4 that makes startup on Windows ... by xpaulbettsx on Sunday January 23, 2011 @05:59PM (#2133582)
Interesting. I've worked on SuperFetch and I didn't know that!
Re:20-line patch to Firefox 4 that makes startup on Windows ... by slightlyoff on Monday January 24, 2011 @05:23PM (#2137027)
It's likely that my understanding of the situation is at least partially confused. The "SuperFetch" branding covers a lot of systems with some observably complex interactions. From my recollection of the XPerf traces, we saw misses 10+ MB back in the DLLs and just ascribed it to "SuperFetch" on the front half.

If you could tell me if that's causal, it'd be awesome = )

Re:20-line patch to Firefox 4 that makes startup on Windows ... by holygoat on Saturday January 22, 2011 @09:59PM (#2131658)
No, it won't have a big effect on warm or OS-optimized startup time... but cold startup time, especially for new releases, is a big area of concern, so it's nice to see wins there!
Re:20-line patch to Firefox 4 that makes startup on Windows ... by simcop2387 on Sunday January 23, 2011 @12:20AM (#2131844)
While I doubt my specific hypothetical case will actually exist... I think it should also help if the OS has decided not to prefetch the dll for you for some reason. I don't believe it should ever actually hurt but should make it a lot nicer on any of the possible edge cases.