Saturday, 26 August 2017

Launch Applications Faster :Preload in Linux

Wanna speed up Launch time of Applications in Linux then read on.

Preload is a package that enables a service which can preload libraries required for Applications in the Ram. Obviously reading from ram is way more faster than reading from the disk. That's where your system gains up speed and can launch applications faster.




RAM

One important thing to ensure before installing preload and enabling the service is noting down the current RAM usage if you have sufficient RAM to spare go ahead and install Preload. You can check your ram usage in gnome-system-monitor if you are using a gnome based system, for xfce you can use task-manager.

Adaptive Readahead Demon


Preload can be termed as an adaptive Readahead Demon. It notices what applications the users run and what applications fetch before launching. It then preloads whatever applications fetch leading to faster startup.

Boot Times

Ignorant People will go ahead and claim that preload speeds up boot, however that is not the case. Rather is impossible to speed up your boot time with preload since the service is launched much later.
Simply remember Preload will not improve your boot times. Upgrading to a SSD is something that will definitely speed up your boot time & application startup time. With an SSD you wouldn't infact need preload and I would advise against it.

As a matter of fact, I personally believe that preload would instead increase your boot time, because it is loading into memory a few additional bytes which would otherwise not be preloaded. It does however makeup for this additional loading time with faster application startup. Application startup gain is way more than the increase in the boot time.

Installing Preload

Ubuntu 16.04


sudo apt update
sudo apt install preload

As far as I know the preload service will be automatically enabled in case of Ubuntu.

Manjaro Gellivara 17.0.2

Preload is available as a community package(repository), so using the following command should do the trick. Also you would need to enable the service by firing the second command.

sudo pacman -S preload
sudo systemctl enable preload.service

In case it is not present in the community you could get it from the AUR by using yaourt

yaourt preload

Note : Don't launch yaourt with sudo (for any package.)

Hey Wait Doesn't the Linux Kernel Also Cache Data ?

So if the linux kernel does cache data then why exactly do I need preload. The linux kernel does cache data but only when the library was used once. It doesn't prefetch it ,before the first launch.

Eg: If I launch Chromium for the first time, Linux will cache the libraries required for it, if RAM is available. The next time I launch it , it would be launched faster.

However with preload, I am going to see a speedup the very first time Chromium is launched.

So Should I use Preload ?

Whether or not to use preload depends on the two following things:
  • SSD : If you have a SSD don't use preload, the application speed up is going to be minimal
  • RAM: Use preload only if you have got enough ram to spare

Why is not included in Distributions by Default ?

I have no idea. Go ahead and ask the dev teams why they don't include preload.

No comments:

Post a Comment