Speed up boot times

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
megaman

Re: Speed up boot times

Unread post by megaman » 2014-02-13, 03:31

The information based on my desktop, in form of a video, can be found here. I also added a description of the results on that same post.
http://forum.palemoon.org/viewtopic.php ... =80#p21914

This information based on my laptop, read the "Edit" part.
http://forum.palemoon.org/viewtopic.php ... 844#p22593

TELVM

Re: Speed up boot times

Unread post by TELVM » 2014-02-15, 01:40

This is what I do to speed up Pale Moon boot times and browsing in general.

Create a ramdisk of appropiate size. I use Primo Ramdisk (direct I/O, dynamic memory management, FAT32, default cluster size). No ramdisk image is saved or loaded, the ramdisk contents vanish on shutdown.

Then extract the Portable version of Pale Moon into a folder in the ramdisk, say R:\PaleMoon Portable .

Then copy the content of that folder into an HDD, say at E:\PaleMoon Portable BackUp .

Now we need two batch files. The first one say HDDtoRAM.bat will copy the browser from HDD to RAM after Windows starts up:

Code: Select all

REM ***************************************************************************
REM *  ON STARTUP COPY ALL PALEMOON PORTABLE FILES FROM HDD E: TO RAMDISK R:  *
REM ***************************************************************************
REM
SET COPYCMD=/Y
XCOPY E:\"PaleMoon Portable BackUp"\*.* R:\"PaleMoon Portable" /Q /D /I /E /Y /R

The second batch file say RAMtoHDD.bat will save the browser back to HDD from RAM before Windows shuts down:

Code: Select all

REM ****************************************************************************
REM *  ON SHUTDOWN COPY ALL PALEMOON PORTABLE FILES FROM RAMDISK R: TO HDD E:  *
REM ****************************************************************************
REM
SET COPYCMD=/Y
XCOPY R:\"PaleMoon Portable"\*.* E:\"PaleMoon Portable BackUp" /Q /D /I /E /Y /R

Now to make Windows automatically execute these two batch files, run gpedit.msc and go for:

User Configuration => Windows Settings => Scripts (Log On/Log Off) => Log On => Add => Browse to and select C:\HDDtoRAM.bat => OK => OK

Now for the second batch file click on Log Off => Add => Browse to and select C:\RAMtoHDD.bat => OK => OK


Thus the browser always starts and runs at ramdisk speed (close to RAMming speed):
Image
On a 3-year old system Pale Moon boots in ~3.5 secs and the browsing experience is noticeably faster. Even an ancient P4 Preshott system can boot up Pale Moon in ~8 secs using this trick. This with several add-ons like adblock, flashblock, etc.

As a bonus the SSD is spared a ton of writes (which isn't really a problem but is welcomed).


If there is a power outage without UPS and the ramdisk content vanishes, the back up in the HDD will restore Pale Moon again into ramdisk upon restart.

megaman

Re: Speed up boot times

Unread post by megaman » 2014-02-15, 15:30

I got around the same, about 3 seconds on loading with the RAM disk, so something is holding back the true/raw power.
With the Pre-loader it was 750 miliseconds to 1 second tops.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Speed up boot times

Unread post by Moonchild » 2014-02-15, 18:28

The difference is that the preloader (apparently) creates a booted and initialized version of the browser, and you don't when loading it from a RAM-disk. Both methods have their pros and cons. It's not holding back power, it's simply a matter of how much of the browsing session you start. A RAM-disk cuts out all the disk I/O delays there may be (which tends to be a big factor for startup) but code still has to be initialized when starting the application. If I understood the preloader correctly, it actually starts the browser (doesn't just pre-load components into memory) and loads up a session in a hidden window, meaning you actually have a copy of Pale Moon actively running on your system. As already noticed that can cause issues with saved sessions, and it may also be a potential security risk because you have an active internet application that is completely hidden.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

TELVM

Re: Speed up boot times

Unread post by TELVM » 2014-02-15, 20:19

BTW if we like to use use CCleaner to clean/compact the browser database, it will need a little orientation to find Pale Moon Portable when it's running from a ramdisk. Add this line to the ccleaner.ini file:

CustomLocation1="FIREFOX|R:\PaleMoon\User\Palemoon\Profiles\Default"

dark_moon

Re: Speed up boot times

Unread post by dark_moon » 2014-02-15, 21:50

Pale Moon can delete unnecessary files itself. No need for using the crap cleaner.

hackerman1
Lunatic
Lunatic
Posts: 385
Joined: 2013-12-19, 15:12
Location: Sweden

Re: Speed up boot times

Unread post by hackerman1 » 2014-02-16, 05:40

TELVM wrote:This is what I do to speed up Pale Moon boot times and browsing in general.

Create a ramdisk of appropiate size. I use Primo Ramdisk (direct I/O, dynamic memory management, FAT32, default cluster size). No ramdisk image is saved or loaded, the ramdisk contents vanish on shutdown.

Now we need two batch files. The first one say HDDtoRAM.bat will copy the browser from HDD to RAM after Windows starts up:
The second batch file say RAMtoHDD.bat will save the browser back to HDD from RAM before Windows shuts down:
No ramdisk image saved ?
Athough not an image you save the content with the second bat-file.....

If you want to speed up the booting ( of the computer) then you should use a ramdisk that loads an image, instead of copying files to the ramdisk.
And put the browsercache on ramdisk if you haven´t already done that.
Use exFAT for the cache as it should give you better speed than FAT32, exFAT it´s better with a lot of smaller files, like in a cache.
I have used both FAT32 and exFAT, and i believe i have got Firefox working a little bit better with exFAT.
Note: i have not used FAT32 with Pale Moon, but i don´t expect to see any diffence compared to Firefox.

Personally i use Dataram´s free Ramdisk which supports 4GB and can use unmanaged memory( above 4GB on 32-bit O/S):
http://memory.dataram.com/products-and-services/software/ramdisk

I load an image to the ramdisk when booting, which is very fast,
i can´t notice any "real" difference with or without that image loading (maybe it takes a few seconds extra).

More info here: http://forum.palemoon.org/viewtopic.php?f=19&t=1505&p=20855#p20855
Administrator on Windows Server to Workstation
Moderator (and "undercover" Admin) on The Windows Club Forum

Security: EAM, Comodo Firewall and HIPS, WinPatrol+, HOSTS-file, UAC (max), Sandboxie, NoScript and ADBlock.

TELVM

Re: Speed up boot times

Unread post by TELVM » 2014-02-16, 11:20

dark_moon wrote:Pale Moon can delete unnecessary files itself. No need for using the crap cleaner.
From the timestamps in the pref storage.vacuum.last.places.sqlite it can be many days between vacuumings. Ccleaner does it fine whenever I want. SpeedyFox too.


@ Hackerman: I use a 4GB sized ramdisk, saving and loading an image of it would take long times. On the other hand just the 100~200MB Pale Moon Portable folder can be xcopied to ramdisk in about one second at start up, and saved to HDD in even less time on shutdown as only new or modified files will be xcopied back.

Besides I want everything else in the ramdisk to be disintegrated on shutdown, so saving an image is out of the question.

The Dataram is fine and free but lacks direct I/O, which gives a huge boost on accessing small files. See here for a superb ramdisk roundup and testing: Link.

link68759

Re: Speed up boot times

Unread post by link68759 » 2014-02-17, 01:52

TELVM- using palemoon portable adds unnecessary overhead- and there's no particular need for it here.

hackerman1- using an image file is just as slow as what TELVM suggested, and for the same reason. An image still has to be moved from storage to RAM, which is not much different from copying the files.

As always when someone mentions ccleaner- I'll mention that it is snake oil. Moreover, it is always wiser to use the cleaning tools built into each program.

Here's a rough set of directions for profile sync daemon like hourly backup. Make a manual backup of your profile just in case.

I'm using and recommending rsync. I have rsync installed through cygwin, but there are other ways of getting it I think. P:\ Is my ramdisk. You need to change the windows username and profile folder to match your setup. Take careful note of the direction of the slashes / \

Make a batch file palemoonsync.bat with the following,

Code: Select all

C:\cygwin64\bin\rsync -AaoghP --exclude=parent.lock --exclude=_CACHE_CLEAN_ --exclude=Cache --delete-after --inplace --no-whole-file "/cygdrive/p/765rfyjfgf.Link" "/cygdrive/c/users/Link/Appdata/Roaming/Moonchild Productions/Pale moon/Profiles/" && icacls "C:\users\link\appdata\roaming\moonchild productions\pale moon\Profiles\765rfyjfgf.Link" /reset /t /c /q
Make another batch file palemooncopyprofile.bat

Code: Select all

C:\cygwin64\bin\rsync -AaoghP --exclude=Cache --inplace --no-whole-file "/cygdrive/c/users/Link/Appdata/Roaming/Moonchild Productions/Pale moon/Profiles/765rfyjfgf.Link" "/cygdrive/p/" && icacls P:\765rfyjfgf.Link /reset /t /c /q
In your Profiles.ini file, change IsRelative=0 and Path=P:\765rfyjfgf.Link ( yes, use P:\ not P:/)

Now we can put these in task scheduler. Not all systems have access to gpedit.msc, and gpedit also requires admin access.... It's not a good idea to schedule running a bat file as admin- anyone could potentially insert commands into that file and it's just poor practice to leave a gaping hole like that :P

You can create the hourly task as a user by running in cmd:

Code: Select all

schtasks /create /sc hourly /tn pmloader /tr "path\to\palemoonsync.bat"
However you will need administrative privileges to create a task that runs at login, so I would personally just drop the other batch file in your startup folder, or better yet, have it launched by your ramdisk software (softperfect ramdisk can automatically run programs after mounting the ramdisk). I haven't tried the RAMdisk software recommended in this thread, but softperfect's implementation integrates nicely with UAC, so you cannot dismount your ramdisk without administrative privs.

I think task scheduler might have some implementation for running tasks when you log off, I'll look into that too.

My cache was inside my profile folder by default, but that might not be the case for everyone. Go to about:cache and see where your cache is located. You might want to move it inside your profile so it gets placed on the ramdisk.

FYI: rsync only copies the *difference* between two files, and intelligently detects when files don't need updating. It's designed to move files as efficiently as possible using the least amount of bandwidth, so the hourly backup process only takes a few seconds no matter how big your profile folder is.

Edit: updated the commands: now working for rsync cygwin, still untested
Edit2: Trying to test it, but cygwin's file permission support is broke and strange things are happening.
Edit3: I got it to work by just resetting the permissions afterward with icacls, not sure what negative side effects this may have, if any. I also am excluding the cache- I don't know if my SSD or RAMdisk suck, but the initial sync takes quite a while for me, even without the cache! As such, it might be a good idea to use ramdisk with images afterall, because it can get most of that out of the way before user login. I recommend that you have the session manager extension installed and have it save sessions outside of the ramdisk, and I recommend that you create at least one manual backup of your profile, just in case there's some sort of [unlikely] catostrophic failure. Firefox sync will keep your passwords, history and bookmarks, and extensions intact, so even if you lose your profile, between firefox sync and session manager, you're well covered for any eventuality.
Last edited by link68759 on 2014-02-18, 05:48, edited 9 times in total.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Speed up boot times

Unread post by Moonchild » 2014-02-17, 16:36

Poking my head in briefly I can mention that I'm working on improving start-up times in Pale Moon itself, as well, by pre-compiling the start-up cache and switching packaging method (considering .jar packaging is not really efficient anymore since Mozilla did a packaging overhaul (causing jar packaging to have way too many files in the application folder structure that could have been packed), and it's causing issues with the status bar code - I'll be using omnijar packaging in the future to lower disk I/O required upon start-up and enabling read-ahead).

Of course the drawback is that "making quick and dirty edits" to javascript modules and components will be a lot more difficult. Something's got to give though, and if you have a proper zip archive supporting file manager you can still manage the hacks just fine (e.g. by using Total Commander).
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

megaman

Re: Speed up boot times

Unread post by megaman » 2014-02-17, 16:45

I tried the suggestion from a RAMDisk program that suggests putting the cache on the RAMDisk, start-up is improved in a way. Very comfortable with this function, for now.

hackerman1
Lunatic
Lunatic
Posts: 385
Joined: 2013-12-19, 15:12
Location: Sweden

Re: Speed up boot times

Unread post by hackerman1 » 2014-02-18, 02:47

TELVM wrote:See here for a superb ramdisk roundup and testing: Link.
THANKS !

I´m checking it right now....
Administrator on Windows Server to Workstation
Moderator (and "undercover" Admin) on The Windows Club Forum

Security: EAM, Comodo Firewall and HIPS, WinPatrol+, HOSTS-file, UAC (max), Sandboxie, NoScript and ADBlock.

link68759

Re: Speed up boot times

Unread post by link68759 » 2014-02-18, 05:40

note: I updated my instructions- everything works now.

jumba

Re: Speed up boot times

Unread post by jumba » 2014-02-18, 08:23

link68759 wrote:note: I updated my instructions- everything works now.
link, I think you should post your tutorial to here Pale Moon forum • View forum - Tutorials/Howtos
Moonchild wrote:Poking my head in briefly I can mention that I'm working on improving start-up times in Pale Moon itself, ...
Great news! :thumbup:

TELVM

Re: Speed up boot times

Unread post by TELVM » 2014-02-18, 11:12

hackerman1 wrote:THANKS !
You're welcome :) . There is great info in there, this graph is most interesting:
Image

link68759

Re: Speed up boot times

Unread post by link68759 » 2014-02-20, 07:32

jumba wrote:
link68759 wrote:note: I updated my instructions- everything works now.
link, I think you should post your tutorial to here Pale Moon forum • View forum - Tutorials/Howtos
I will when I fine tune it. I think I worked out how to get cygwin to behave with ACLs, but the odd thing is I did not need to take that route on one of my PCs. This is most definitely reliant on cygwin though, no way around it, unless you wanted to forgo the invaluable benefits of rsync and use xcopy :P

olino

Re: Speed up boot times

Unread post by olino » 2014-02-20, 23:58

Im using 400mb as a ramdisk (exFAT) and i set browser.cache.disk.capacity 300000 but when my ramdisk is full pages wont load correctly, any help? why it does not delete somehow automatically?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Speed up boot times

Unread post by Moonchild » 2014-02-21, 19:19

Make sure you give plenty of headroom to the browser to do proper cache management - the browser does delete files when the cache is full, but your disk is probably filling up before the cache limit is reached. Keep in mind the (probably large) overhead you have in the filesystem itself when caching a large number of small files. Make sure the disk doesn't get completely full, in other words. Either lower the cache size or increase your ram disk size.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

TELVM

Re: Speed up boot times

Unread post by TELVM » 2014-03-11, 19:41

The new 24.4 starts up noticeably faster, way to go :thumbup: .

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Speed up boot times

Unread post by Moonchild » 2014-03-11, 21:22

TELVM wrote:The new 24.4 starts up noticeably faster, way to go :thumbup: .
Glad to hear the work put in paid off for you :)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked