# Make Mozilla render faster

## phunkphorce

I thought this might be of interest to anybody.

Reading the Mozilla forums, I found something that makes it render pages faster. Add this to your own prefs.js (should be somewhere under the .mozilla/ folder in your home directory):

```
user_pref("nglayout.initialpaint.delay", 0);
```

By default Mozilla comes with it set to 500 and in Phoenix it is set to 250 (that's why Phoenix feels faster when rendering)

I've been using for a few weeks now and definitely Mozilla feels much faster, and I haven't found any side effect yet  :Wink: 

PS.: Don't ask me about any technical reason for this. I simply found it, tested it and noticed the increase of speed...   :Smile: 

*** UPDATE ***

FYI, I found the source of this information. It wasn't the Mozilla forums as I previously said but in this Slashdot comment: http://slashdot.org/comments.pl?sid=49452&cid=4994607. From that article you can jump to this BugZilla bug, http://bugzilla.mozilla.org/show_bug.cgi?id=180241 if you want to have some more information about this setting. Status of the bug is REOPENED and it seems that there has been some discussion about it lately.

Oh, and sorry for not stating the source of this information in my original post  :Embarassed: 

----------

## charlieg

I would imagine the delay is to wait for the entire html to be downloaded so the page doesn't adjust in the eyes of the view as <table> tags get completed.

----------

## idl

i prefer to see the page transform infront of me, makes things seem faster like its actualy doing something, defo gonna try this when i get home  :Smile: 

Cheers

----------

## idl

for those using phoenix its in the file called all.js and the code is allmost the same as above but without the user_ part

```
pref("nglayout.initialpaint.delay", 0);
```

----------

## sessionID

Thanks, great tip! 

I have adsl, and delay = 0 works great (pages load *fast*). 

OTOH on some slower and complex sites (cnn.com, netscape.com) re-drawing makes the full rendering a bit slower (but I think I'll keepit 0  :Wink:  ).

BTW, the bugzilla entry is really interesting.

----------

## phunkphorce

Well, one thing I'd like to point out is that this doesn't really make Mozilla render faster. It just makes the user feel that the page rendered faster because the time it takes between mozilla gets the last chunk of data and when it shows it has been reduced to 0. It's the same idea behind the preemptive patches for the kernel: they don't make it run faster but they make the whole system feel more responsive and snappier (specially the X environment)

You can have more detailed technical information about it if you follow the link to the BugZilla page  :Smile: 

----------

## DArtagnan

 *phunkphorce wrote:*   

> I thought this might be of interest to anybody.
> 
> Reading the Mozilla forums, I found something that makes it render pages faster. Add this to your own prefs.js (should be somewhere under the .mozilla/ folder in your home directory):
> 
> ```
> ...

 

The file that need to be edited is:

.mozilla/default/9m75z100.slt/prefs.js

But the problem is that mozilla changes this file back to the old values so I changed the owner to root  :Smile: 

Any clue?

----------

## phunkphorce

 *DArtagnan wrote:*   

> 
> 
> But the problem is that mozilla changes this file back to the old values so I changed the owner to root 
> 
> Any clue?

 

It has to be done when Mozilla's not running  :Smile: 

----------

## DArtagnan

 *phunkphorce wrote:*   

>  *DArtagnan wrote:*   
> 
> But the problem is that mozilla changes this file back to the old values so I changed the owner to root 
> 
> Any clue? 
> ...

 

Did  :Sad: 

Mozilla changes all back

----------

## CoronaLover

Woohoo...thanks!!

mozilla is allot faster now   :Very Happy: 

----------

## Carlo

 *DArtagnan wrote:*   

> Did 
> 
> Mozilla changes all back

 

I have the same problem.

Carlo

----------

## phunkphorce

If it doesn't work, you might want to try to add almost the same to the file /usr/lib/mozilla/defaults/pref/unix.js:

```
pref("nglayout.initialpaint.delay", 0);

```

I'm just guessing now, so your mileage may vary. What I'm really sure is that the original fix works fine for window$  :Smile: 

----------

## delta407

 *phunkphorce wrote:*   

> It's the same idea behind the preemptive patches for the kernel: they don't make it run faster but they make the whole system feel more responsive and snappier

 Well, kind of, not really. User-space threads (like X) work in a pre-emptive fashion, as they have from day one; kernel-space threads are now subject to a similar scheduling system, meaning that user-space threads get control in a more orderly fashion and that kernel blocks are less of an issue.

----------

## Carlo

@phunkphorce: Sure, but why the hell mozilla doesn't respect changes made by users!? Thx anyway! Loading sites from slow servers is smarter now, if you know you want to click on one already shown link.

Carlo

----------

## phunkphorce

 *delta407 wrote:*   

>  *phunkphorce wrote:*   It's the same idea behind the preemptive patches for the kernel: they don't make it run faster but they make the whole system feel more responsive and snappier Well, kind of, not really. User-space threads (like X) work in a pre-emptive fashion, as they have from day one; kernel-space threads are now subject to a similar scheduling system, meaning that user-space threads get control in a more orderly fashion and that kernel blocks are less of an issue.

 

Well, maybe the example I chose wasn't really the best one... I simply tried to mean that it's not that Mozilla renders pages fasters but that it seems that it renders faster, just because it shows something faster. I remember that back in the days when I was at the university studying operating systems, there were several different ways to measure the efficiency of an operating system, and as far as I remember one of them was based on how fast a process can show some data to the user (or something like that  :Smile: )

I think in this case is the same. Setting that value to 0, as I have suggested, doesn't Mozilla make faster at all, but you get to see things faster even if Mozilla hasn't finished loading the page. For example everytime I reload this page in the forums I can see how it is built and it is redrawn at least a couple of times, kind of what Explorer does. So, my own subjective impression is that it works faster, just as the X-Window feels faster and snappier when all the preemption patches are applied in your kernel.

Hmmm, hope it sounds better now  :Smile: , but thanks for giving a more technical view anyway   :Cool: 

----------

## bassvandijk

Thnx!!! 

I edited: "/usr/lib/phoenix/defaults/pref/all.js" and now my phoenix is very fast.

----------

## DArtagnan

 *CoronaLover wrote:*   

> Woohoo...thanks!!
> 
> mozilla is allot faster now  

 

what file u've changed?

----------

## ghetto

Id like to modify it but it seem like i dont have that line in my prefs.js file...

Im using: Mozilla 1.2.1

here is the path: .mozilla/default/f4ph3cco.slt/prefs.js

here is the file:

# Mozilla User Preferences

// This is a generated file!

user_pref("browser.chrome.toolbar_style", 0);

user_pref("browser.chrome.toolbar_tips", false);

user_pref("browser.download.dir", "888");

user_pref("browser.search.defaultengine", "engine:///usr/lib/mozilla/searchplugins/google.src");

user_pref("browser.search.opensidebarsearchpanel", false);

user_pref("browser.startup.homepage", "http://www.mozilla.org/start/");

user_pref("browser.startup.homepage_override.mstone", "rv:1.2.1");

user_pref("browser.tabs.loadInBackground", true);

user_pref("browser.tabs.opentabfor.middleclick", true);

user_pref("dom.disable_open_during_load", true);

user_pref("editor.history_title_0", "");

user_pref("editor.history_url_0", "about:blank");

user_pref("extensions.enigmail.alwaysTrustSend", true);

user_pref("extensions.enigmail.configuredVersion", "0.71.0.0");

user_pref("extensions.enigmail.confirmBeforeSend", false);

user_pref("extensions.enigmail.defaultEncryptionOption", 0);

user_pref("extensions.enigmail.defaultSignMsg", false);

user_pref("extensions.enigmail.disableSMIMEui", true);

user_pref("extensions.enigmail.encryptToSelf", true);

user_pref("extensions.enigmail.logDirectory", "");

user_pref("extensions.enigmail.parseAllHeaders", true);

user_pref("extensions.enigmail.useMimeExperimental", false);

user_pref("extensions.enigmail.usePGPMimeOption", 0);

user_pref("extensions.enigmail.userIdFromAddr", true);

user_pref("extensions.enigmail.userIdValue", "");

user_pref("extensions.venkman.lastErrorMode", "ignore");

user_pref("extensions.venkman.lastThrowMode", "ignore");

user_pref("extensions.venkman.layoutState.default", "x-vloc:/mainwindow/initial-container?target=container&id=outer&type=horizontal; x-vloc:/mainwindow/outer?target=container&id=gutter&before=vright&type=vertical; x-vloc:/mainwindow/gutter?target=view&id=scripts&before=stack; x-vloc:/mainwindow/gutter?target=view&id=stack");

user_pref("extensions.venkman.prettyprint", false);

user_pref("extensions.venkman.startupCount", "1");

user_pref("font.minimum-size.x-western", 10);

user_pref("font.name.cursive.x-western", "Andale Mono");

user_pref("font.name.fantasy.x-western", "Andale Mono");

user_pref("font.name.monospace.x-western", "Andale Mono");

user_pref("font.name.sans-serif.x-western", "Andale Mono");

user_pref("font.name.serif.x-western", "Andale Mono");

user_pref("font.size.variable.x-western", 14);

user_pref("general.open_location.last_url", "file:///***");

user_pref("ldap_2.prefs_migrated", true);

user_pref("ldap_2.servers.history.filename", "history.mab");

user_pref("ldap_2.servers.history.replication.lastChangeNumber", 0);

user_pref("ldap_2.servers.pab.filename", "abook.mab");

user_pref("ldap_2.servers.pab.replication.lastChangeNumber", 0);

user_pref("mail.account.account1.identities", "id1");

user_pref("mail.account.account1.server", "server1");

user_pref("mail.account.account2.server", "server2");

user_pref("mail.accountmanager.accounts", "account1,account2");

user_pref("mail.accountmanager.defaultaccount", "account1");

user_pref("mail.accountmanager.localfoldersserver", "server2");

user_pref("mail.default_html_action", 1);

user_pref("mail.identity.id1.draft_folder", "mailbox://***");

user_pref("mail.identity.id1.drafts_folder_picker_mode", "0");

user_pref("mail.identity.id1.fcc_folder", "mailbox://***");

user_pref("mail.identity.id1.fcc_folder_picker_mode", "0");

user_pref("mail.identity.id1.fullName", "Wouldn't you like to know.");

user_pref("mail.identity.id1.smtpServer", "smtp1");

user_pref("mail.identity.id1.stationery_folder", "mailbox://***/Templates");

user_pref("mail.identity.id1.tmpl_folder_picker_mode", "0");

user_pref("mail.identity.id1.useremail", "***");

user_pref("mail.identity.id1.valid", true);

user_pref("mail.root.none", "***");

user_pref("mail.root.pop3", "/home/alex/.mozilla/default/f4ph3cco.slt/Mail");

user_pref("mail.server.server1.directory", "/home/alex/.mozilla/default/f4ph3cco.slt/Mail/**");

user_pref("mail.server.server1.download_on_biff", true);

user_pref("mail.server.server1.hostname", "**");

user_pref("mail.server.server1.login_at_startup", true);

user_pref("mail.server.server1.name", "**");

user_pref("mail.server.server1.type", "pop3");

user_pref("mail.server.server1.userName", "**");

user_pref("mail.server.server2.directory", "/home/alex/.mozilla/default/f4ph3cco.slt/Mail/Local Folders");

user_pref("mail.server.server2.hostname", "Local Folders");

user_pref("mail.server.server2.name", "Local Folders");

user_pref("mail.server.server2.type", "none");

user_pref("mail.server.server2.userName", "nobody");

user_pref("mail.show_headers", 2);

user_pref("mail.smtp.defaultserver", "smtp1");

user_pref("mail.smtpserver.smtp1.hostname", "**");

user_pref("mail.smtpserver.smtp1.username", "**");

user_pref("mail.smtpservers", "smtp1");

user_pref("network.cookie.cookieBehavior", 0);

user_pref("network.ftp.anonymous_password", "");

user_pref("plugin.soname.list", "libXt.so:libXext.so");

user_pref("prefs.converted-to-utf8", true);

user_pref("security.warn_entering_secure", false);

user_pref("security.warn_leaving_secure", false);

user_pref("security.warn_submit_insecure", false);

user_pref("signon.SignonFileName", "41032425.s");

user_pref("timebomb.first_launch_time", "1041031716549698");

user_pref("update_notifications.provider.0.last_checked", 1041681525);

user_pref("wallet.SchemaValueFileName", "41032507.w");

user_pref("wallet.caveat", true);

----------

## fghellar

 *ghetto wrote:*   

> Id like to modify it but it seem like i dont have that line in my prefs.js file...

 

 *phunkphorce wrote:*   

> Add this to your own prefs.js

 

So, just put it there...   :Cool: 

----------

## ghetto

 :Embarassed: 

oops, heh heh...

----------

## nertzy

 *DArtagnan wrote:*   

> The file that need to be edited is:
> 
> .mozilla/default/9m75z100.slt/prefs.js
> 
> But the problem is that mozilla changes this file back to the old values so I changed the owner to root 
> ...

 

Don't edit prefs.js

The proper file to edit is user.js in the same directory.  Mozilla imports these settings into prefs.js at runtime.

This is supposed to ensure that users don't muck up their working prefs files by testing the user.js settings before importing them.  Once you've done this I think you'll find it works much nicer.

(also 9m75z100 is an autogenerated string unique to your computer and will be different on everyone's machines)

----------

## s0be

I believe you need to create a file called user.js and put it in there... mozilla generates it's js file from it's defaults, using user.js as an override

s0be

::edit:: d'oh... somone beat me to it

----------

## ghetto

maybe your right, maybe your wrong.. all i know is it put it in the existing .js file while moz wasnt running and then i started moz and it was quicker... so then i opened the .js file that i edited and YES it was still there.. although it had moved about twenty lines down the file.. which is a little strange but who cares its still there and thats all i really care about   :Rolling Eyes: 

----------

## Zu`

 *s0be wrote:*   

> I believe you need to create a file called user.js and put it in there... mozilla generates it's js file from it's defaults, using user.js as an override
> 
> 

 

I tried that. Works fine, it's a lot faster indeed (at least no unneeded delay anymore).

It feels very speedy and that's nice  :Smile: 

----------

## DArtagnan

 *Zu` wrote:*   

>  *s0be wrote:*   I believe you need to create a file called user.js and put it in there... mozilla generates it's js file from it's defaults, using user.js as an override
> 
>  
> 
> I tried that. Works fine, it's a lot faster indeed (at least no unneeded delay anymore).
> ...

 

Indeed

----------

## phunkphorce

Happy to see that people find this tip useful   :Cool: 

----------

## sessionID

... and we're happy that You share it!

----------

## kerframil

 :Very Happy:  I like it ... I like it very much. The default setting is definitely too conservative. Someone should maintain a database of the Mozilla preference keys, if they aren't already ...

----------

## sessionID

Try hacking these: 

```
about:config
```

----------

## kerframil

 *sessionID wrote:*   

> Try hacking these: 
> 
> ```
> about:config
> ```
> ...

 

Thanks a lot. They are quite self-explanatory, more's the better!

----------

## phunkphorce

 *kerframil wrote:*   

>  I like it ... I like it very much. The default setting is definitely too conservative. Someone should maintain a database of the Mozilla preference keys, if they aren't already ...

 

Well, you can try to use MozTweak, a small tool that will let you change some of those 'hidden' settigns from within the Mozilla GUI. You can find MozTweak here: http://mozillapl.mozdev.org/

----------

## kappax

I added this too , i dont know if it helps but i seen it somewhere.

```

user_pref("browser.turbo.enabled", true);

```

----------

## DArtagnan

 *phunkphorce wrote:*   

>  *kerframil wrote:*    I like it ... I like it very much. The default setting is definitely too conservative. Someone should maintain a database of the Mozilla preference keys, if they aren't already ... 
> 
> Well, you can try to use MozTweak, a small tool that will let you change some of those 'hidden' settigns from within the Mozilla GUI. You can find MozTweak here: http://mozillapl.mozdev.org/

 

Got it from CVS, now what? I don't see any README over there...

----------

## nichao

"browser.turbo.enabled" is supposed to enable/disable the quicklaunch option for windows (Mozilla stays in RAM - just like IE does - to start up faster). Shouldn't do much for a Linux Mozilla then, of course.

----------

## dioxmat

I've set it to 200 and its enough.

btw, it also works with mail&news and chatzilla, not only the browser.

[edit] reverted to 250 (phoenix default, will see if thats enough to fix my problems), as I was seeing some glitches :

- sometimes the urlbar wasnt updated.

- sometimes some pages didnt fully render. i.e. on this thread, the boutons

  edit/quote were cut.

- sometimes when I opened a new tab mozilla did not focus it as it should.

----------

## phunkphorce

 *DArtagnan wrote:*   

>  *phunkphorce wrote:*    *kerframil wrote:*    I like it ... I like it very much. The default setting is definitely too conservative. Someone should maintain a database of the Mozilla preference keys, if they aren't already ... 
> 
> Well, you can try to use MozTweak, a small tool that will let you change some of those 'hidden' settigns from within the Mozilla GUI. You can find MozTweak here: http://mozillapl.mozdev.org/ 
> 
> Got it from CVS, now what? I don't see any README over there...

 

I don't really know how to install it from CVS... The easiest way is to go to the project's site and click on "Installation" and then finally click on "MozTweak Addon 1.2". The browser should do everything then. Once it has been downloaded and installed, restart the browser and next time you start it you should have a new section in the "Preferences" dialog.

----------

## DArtagnan

This works for galeon also...

----------

## kerframil

 *Quote:*   

> reverted to 250 (phoenix default, will see if thats enough to fix my problems), as I was seeing some glitches :
> 
> - sometimes the urlbar wasnt updated.
> 
> - sometimes some pages didnt fully render. i.e. on this thread, the boutons
> ...

 

Yup. I've realised I'm getting some problems in my gtk2 Mozilla as well, and Phoenix (which I hadn't modified) is not exhibiting them.

EDIT: It may just be becuase gtk2 mozilla is really buggy! I'm going to try again with mozilla compiled against gtk1.

----------

