Firefox – Why does firefox load significantly faster on the second launch

bootfirefox

I mean the second process launch. I startup the process (on Linux, using any version 3.x), it takes 5 seconds to load. Then I kill the process. There is no instance of firefox running. I startup firefox a second or third or forth time… and it always starts very quickly.

My question: why? Are we talking caching of whatever files firefox depends on? Do I need to defragment my hard disk? Is firefox running through various webpages its got cached locally (including its persistent web history)? Or does it cache something in its initialization process (so that the second process launch — not the second window or tab launch — note, that isn't the question) that doesn't persist through reboot? Or is there something with caching in other parts of the memory hierarchy?

I could try to find out. But I honestly don't care all that much (it's not like Chrome is available in a stable format with Flash on Linux, afaik). Not being too into the alternatives (opera, or webkit/khtml solutions, etc.), I don't particularly have a choice. Just curious.

Best Answer

Firefox is still cached in RAM, that's what makes it so fast the second time around. If you'd wait a while before starting it the second time it wouldn't be that fast. The same thing happens in Windows and Mac OS X, not just Linux.