Preload (简体中文)

From ArchWiki
Jump to: navigation, search

预加载的主要作用是让把文件放入RAM中,或者让文件保持在RAM中。这样做的好处是让应用预加载从而更快的打开,因为从内存读取要比从硬盘读取速度更快。虽然这样会使用一部分内存,但不会比应用打开后所需的内存多。所以,预加载最好用于大型的,经常打开的应用,比如 Firefox 和 LibreOffice。

Go-preload

gopreload-gitAUR is a small daemon created in the Gentoo forum. To use it, first run this command in a terminal for each program you want to preload at boot:

# gopreload-prepare program

For regular users, take ownership of /usr/share/gopreload/enabled and /usr/share/gopreload/disabled

# chown username:users /usr/share/gopreload/enabled /usr/share/gopreload/disabled

and then gopreload each program you want to preload:

$ gopreload-prepare program

Then, as instructed, press Enter when the program is fully loaded. This will add a list of files needed by the program in /usr/share/gopreload/enabled. To load all lists at boot, enable the systemd service file gopreload.service.

To disable the loading of a program, remove the appropriate list in /usr/share/gopreload/enabled or move it to /usr/share/gopreload/disabled.

It is advised to run gopreload-prepare after system upgrades to refresh the file lists. For the task, the following batch tool come handy:

# gopreload-batch-refresh.sh

Just let it run without using the system.

配置

The configuration file is located in /etc/gopreload.conf

Preload

preload is a program written by Behdad Esfahbod which runs as a daemon and records statistics about usage of programs using Markov chains; files of more frequently-used programs are, during a computer's spare time, loaded into memory. This results in faster startup times as less data needs to be fetched from disk.

安装

Install the preloadAUR package. You may now start the systemd service preload, and/or enable it in order to start at boot.

配置

The configuration file is located in /etc/preload.conf, it contains default settings that should be suitable for regular users. The cycle option lets you configure how often to ping the preload system to update its model of which applications and libraries to cache.

参阅