Difference between revisions of "Preload"

From ArchWiki
Jump to: navigation, search
(Go-preload: Describe a new useful batch tool in the latest gopreload-git)
(create)
Line 3: Line 3:
 
[[de:Preload]]
 
[[de:Preload]]
 
[[ja:Preload]]
 
[[ja:Preload]]
Preloading is the action of putting and keeping target files into the RAM. The benefit is that preloaded applications start more quickly because reading from the RAM is always quicker than from the hard drive. However, part of your RAM will be dedicated to this task, but no more than if you kept the application open. Therefore preloading is best used with large and often-used applications like Firefox and LibreOffice.
+
[[zh-CN:Preload]]
 +
预读是一种把目标文件预加载到内存中的行为.这样做得好处是使预加载的程序更快的载入,因为内存的读取速度远快于硬盘。但是, 预读会占用一部分内存用于存放缓存。因此预读最好用于您经常使用的大型应用程序列如 Firefox LibreOffice.
  
 
== Go-preload ==
 
== Go-preload ==
  
{{AUR|gopreload-git}} is a small daemon created in the [https://forums.gentoo.org/viewtopic-t-622085-highlight-preload.html Gentoo forum]. To use it, first run this command in a terminal for each program you want to preload at boot:
+
{{AUR|gopreload-git}} [https://forums.gentoo.org/viewtopic-t-622085-highlight-preload.html Gentoo forum] 创建的一个简单服务.要使用它,首先在终端运行以下命令(‘’program‘’为需要预加载的程序):
  
 
  # gopreload-prepare ''program''
 
  # gopreload-prepare ''program''
  
For regular users, take ownership of {{ic|/usr/share/gopreload/enabled}} and {{ic|/usr/share/gopreload/disabled}}
+
对于普通用户 需要更改 {{ic|/usr/share/gopreload/enabled}} {{ic|/usr/share/gopreload/disabled}} 的所属用户与所属组。
  
 
  # chown username:users /usr/share/gopreload/enabled /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''
 
  $ 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 {{ic|/usr/share/gopreload/enabled}}. To load all lists at boot, [[enable]] the systemd service file {{ic|gopreload.service}}.
+
接着,在程序完全加载完后,根据提示敲击回车. 这将在 {{ic|/usr/share/gopreload/enabled}} 自动添加你想要预读程序所需的文件列表.若想在启动时自动预读,需要 [[enable]] the systemd service file {{ic|gopreload.service}}.
  
To disable the loading of a program, remove the appropriate list in {{ic|/usr/share/gopreload/enabled}} or move it to {{ic|/usr/share/gopreload/disabled}}.
+
要禁用程序的加载, 删除在 {{ic|/usr/share/gopreload/enabled}} 相应的列表 或移动列表到 {{ic|/usr/share/gopreload/disabled}} 即可.
 
+
在系统升级后应该运行 gopreload-prepare 来恢复文件列表。
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
 
  # gopreload-batch-refresh.sh
Line 30: Line 30:
 
Just let it run without using the system.
 
Just let it run without using the system.
  
== 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. ''preload'' is often paired with [[prelink]].
 
'''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. ''preload'' is often paired with [[prelink]].
  
=== Installation ===
+
=== 安装 ===
  
 
[[Install]] the {{AUR|preload}} package. You may now [[Daemon|start]] the [[systemd]] service {{ic|preload}}, and/or enable it in order to start at boot.
 
[[Install]] the {{AUR|preload}} package. You may now [[Daemon|start]] the [[systemd]] service {{ic|preload}}, and/or enable it in order to start at boot.
  
=== Configuration ===
+
=== 配置 ===
  
The configuration file is located in {{ic|/etc/preload.conf}}, it contains default settings that should be suitable for regular users. The {{ic|cycle}} option lets you configure how often to ping the
+
这个程序的配置文件在 {{ic|/etc/preload.conf}}, it contains default settings that should be suitable for regular users. The {{ic|cycle}} option lets you configure how often to ping the
 
preload system to update its model of which applications and libraries to cache.
 
preload system to update its model of which applications and libraries to cache.
  
== See also ==
+
== 参见 ==
  
 
* [[wikipedia:Preload_(software)]]
 
* [[wikipedia:Preload_(software)]]
 
* http://techthrob.com/2009/03/02/drastically-speed-up-your-linux-system-with-preload/
 
* http://techthrob.com/2009/03/02/drastically-speed-up-your-linux-system-with-preload/
 
* [[Improve boot performance]]
 
* [[Improve boot performance]]

Revision as of 11:58, 17 May 2016

zh-CN:Preload 预读是一种把目标文件预加载到内存中的行为.这样做得好处是使预加载的程序更快的载入,因为内存的读取速度远快于硬盘。但是, 预读会占用一部分内存用于存放缓存。因此预读最好用于您经常使用的大型应用程序列如 Firefox 和 LibreOffice.

Go-preload

gopreload-gitAURGentoo forum 创建的一个简单服务.要使用它,首先在终端运行以下命令(‘’program‘’为需要预加载的程序):

# gopreload-prepare program

对于普通用户 需要更改 /usr/share/gopreload/enabled/usr/share/gopreload/disabled 的所属用户与所属组。

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

并去加载你想要预读的程序 :

$ gopreload-prepare program

接着,在程序完全加载完后,根据提示敲击回车. 这将在 /usr/share/gopreload/enabled 自动添加你想要预读程序所需的文件列表.若想在启动时自动预读,需要 enable the systemd service file gopreload.service.

要禁用程序的加载, 删除在 /usr/share/gopreload/enabled 相应的列表 或移动列表到 /usr/share/gopreload/disabled 即可. 在系统升级后应该运行 gopreload-prepare 来恢复文件列表。 可用用下面批处理手动处理

# gopreload-batch-refresh.sh

Just let it run without using the system.

预读

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. preload is often paired with prelink.

安装

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

配置

这个程序的配置文件在 /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.

参见