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!
User avatar
Admin
Site Admin
Site Admin
Posts: 405
Joined: 2012-05-17, 19:06

Re: Speed up boot times

Unread post by Admin » 2014-01-30, 15:09

I've gone through and removed all immaterial/off-topic/uncivil/flaming content from everyone involved.
If you want to continue discussing the pre-loader, go right ahead, but leave preconceptions, assumptions, personal attacks, analogies with mothers, heated debate about wording, "possible impossibilities" and the likes at the door.

Can you all do that? I'm sure you can.

I'll remove any further comments that are off-topic and/or not focused on the practical solutions offered to speed up boot times of the browser.
Did you know that moral outrage triggers the pleasure centers of the brain? It's unlikely you can actually get addicted to outrage, but there is plausible evidence that you can become strongly predisposed to it.
Source: https://www.bbc.co.uk/programmes/p002w557/episodes/downloads - "The cooperative species" and "Behaving better online"
Image

megaman

Re: Speed up boot times

Unread post by megaman » 2014-01-30, 23:33

Let's see here...
I unloaded the Preloader, closed the thread, and installed a new vesion of Palemoon.
Upon the browser loading, my session was gone, and no option to recover it. (Completely grayed-out)
Hope there is a bug due to the steps.

link68759

Re: Speed up boot times

Unread post by link68759 » 2014-02-12, 17:56

It turns out the preloader doesn't work as I thought it did- my method of closing firefox (vimperator's ZZ) is different than the close button (which I had disabled), and was negating the effects of the preloader. When used correctly, it does in fact make palemoon start more or less instantly, even with all my addons.

That said, I personally don't find it stable enough to use, and firefox's startup process seems to involve the creation of a few hidden windows, so my efforts to seamlessly hide the main window at startup through AHK are so far unsuccessful.

I'll continue to try fixing the preloader up, and continue with my AHK solution, but I have a third route as well- using a RAM disk. Someone mentioned that earlier in this thread, but with an SSD I didn't think the marginal performance gain would be worth the hassle and potential instability.

I still think that, particularly under windows where you have to permanently allocate memory to a ramdisk instead of dynamically assigning as needed. But then this article (https://wiki.archlinux.org/index.php/Pr ... ync-daemon) brought up the good point that it spares your SSD from unnecessary read/writes, AND they have implemented an hourly back up of your profile. Not bad.

I'll make a windows equivalent of this, and I'll be playing around with varying solutions for the backup method (recommend users install rsync, or trust windows' copy will work fine? Script a timer or use windows scheduler?), and I guess once I have all three routes working acceptably, I'll create another thread dedicated to discussion of those three solutions.

In the meantime, I can tell you that softperfect ramdisk is just ok, but its "save contents to image every X minutes" feature is -terrible-. In the event that something bad happens to your ramdisk, your image will be overwritten and you'll lose everything in it... Destroying your image when something goes wrong defeats the purpose of having a backup. Rsync would merely not run in these situations, and using rsync to mirror your profile from the ramdisk to the default location is smarter anyhow. Also, you can reliably break the ramdisk by filling it up- it doesn't seem to handle being low on space very well (nor does firefox for that matter).

megaman

Re: Speed up boot times

Unread post by megaman » 2014-02-13, 01:12

Okay, link. Awaiting updates on the Preloader and RAMDisk option.

leegb11

Re: Speed up boot times

Unread post by leegb11 » 2014-02-13, 01:34

A serious question.
Why are people obsessed with how quick a browser opens?
There are thousands of things that can effect this.
My PM gets to my homepage in 3 to 4 seconds with approx 20 add ons - once opened it responds very quickly, but if another browser is quicker I would guess most could not notice it.
I suppose some people have a lot of spare time.

megaman

Re: Speed up boot times

Unread post by megaman » 2014-02-13, 01:39

leegb11 wrote:I suppose some people have a lot of spare time.
We are all different, my friend. Even if it is just one person in this entire world that has a problem with waiting for a browser to load, he/she also counts into the equation.

leegb11

Re: Speed up boot times

Unread post by leegb11 » 2014-02-13, 01:50

Fair Point, just saying that some of the best computer experts in the the world can't work out why something is a second slower - "have you tried turning it off and on", springs to mind!
Anyway I'm enjoying PM so far.

leegb11

Re: Speed up boot times

Unread post by leegb11 » 2014-02-13, 02:42

Am no PC expert, but thinking 8 hours of work = 28,800 seconds - so trying to save a second or two on start-ups seems counter productive. Work out how many times you have to start your browser to equal that.
But my flatmate is a PC expert and don't like being beaten - but even he cannot solve all our problems!

megaman

Re: Speed up boot times

Unread post by megaman » 2014-02-13, 02:53

leegb11 wrote:Am no PC expert, but thinking 8 hours of work = 28,800 seconds - so trying to save a second or two on start-ups seems counter productive. Work out how many times you have to start your browser to equal that.
But my flatmate is a PC expert and don't like being beaten - but even he cannot solve all our problems!
It's like developers making a game that only lasts about 5 hours of gameplay, but it took them 5+ years to develop, test, and release.
If someone can do something about it, we should let them attempt it. Benefits for all.
Have you seen my video? Top of the messages a few pages back.
We can always question people for being who they are, but what they are and what they do/can do could lead to something great.

leegb11

Re: Speed up boot times

Unread post by leegb11 » 2014-02-13, 03:12

Am liking your answers, but new to here and got from rss - don't want to upset admins by treating like a chat site. Am useless with this stuff.
Can you send link to vid then I'll let this go and spend a little time working out the site.

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: 35480
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: 35480
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

Locked