预加载 PlayOnLinux 应用程序?

预加载 PlayOnLinux 应用程序?

我已经使用 ureadahead 和 preload 很长时间了。它工作正常,但我经常不得不使用随 PlayOnLinux 安装的 Microsoft Office 2010。Word、Excel 或 Powerpoint 的第一次加载需要很长时间。这些应用程序的第二次加载时间还可以。

所以我想知道是否有可能预加载这些应用程序?有人能帮我怎么做吗?

我发现还有一个“wine-preloader”,但我无法找到它在这种情况下如何帮助我。我也有点困惑,第一次较长的加载时间是因为 PlayOnLinux 的虚拟机还是因为 Wine 加载了特定的应用程序。

所以我的明确问题是:

  1. 我到底该如何预加载任何内容来加快 Office 应用程序的首次启动速度?
  2. 如果有较长的空闲时间不使用办公应用程序,我可以保留预加载吗?(以避免 60 分钟后再次出现类似“首次加载”的行为)
  3. 当然,我也感谢其他提示。请不要指导我使用 Libre 或 OpenOffice。我知道 :) 但这不是这里的主题。

多谢!

问候,Berzi

答案1

有一个名为/etc/preload.confcalled 的配置选项mapprefix,其默认设置为:

# mapprefix:
#
# A list of path prefixes that controll which mapped file are to
# be considered by preload and which not.  The list items are
# separated by semicolons.  Matching will be stopped as soon as
# the first item is matched.  For each item, if item appears at
# the beginning of the path of the file, then a match occurs, and
# the file is accepted.  If on the other hand, the item has a
# exclamation mark as its first character, then the rest of the
# item is considered, and if a match happens, the file is rejected.
# For example a value of !/lib/modules;/ means that every file other
# than those in /lib/modules should be accepted.  In this case, the
# trailing item can be removed, since if no match occurs, the file is
# accepted.  It's advised to make sure /dev is rejected, since
# preload doesn't special-handle device files internally.
#
# Note that /lib matches all of /lib, /lib64, and even /libexec if
# there was one.  If one really meant /lib only, they should use
# /lib/ instead.
#
# default: (empty list, accept all)
mapprefix = /usr/;/lib;/var/cache/;!/

这意味着默认情况下/usr/lib和中的文件/var/cache符合条件,但其他文件不会被预加载。您可以修改它以包含您想要缓存的程序在磁盘上的路径,例如:

mapprefix = /usr/;/lib;/var/cache/;/home/someone/.winexxx/;!/

给定的 PlayOnLinux 程序的/home/someone/.winexxx在哪里。WINE_PREFIX

另一种选择是使用gopreload命令并手动运行该程序,如下所示:

gopreload WINE_PREFIX=~/.winexxx wine ~/.winexxx/drive_c/foo.exe

尽管 a.) 您需要gopreload手动编译/安装,b.) 您需要确保运行的wine程序正确,并且 PlayOnLinux 会使用前缀和其他设置。如果您可以让 PlayOnLinux 为您创建一个快捷方式或 .desktop 文件,那么您可以通过查看该文件来获取这些内容。

但是,还有一个问题,即 preload 认为代码和数据有什么关系,以及它如何预加载内容。我感觉,wine 执行的大部分操作最终都会被视为数据,而不是预加载。如果您选择这种方式,您需要检查预加载日志文件以查看它实际上在做什么。

一个穷人的解决方案可能是创建一个启动脚本,简单地从磁盘读取这些文件,从而“启动”缓存来包含它们,例如:

ionice -c 3 vmtouch'/home/someone/.winexxx/drive_c/Program Files (x86)/Microsoft Office'

这将ionice在后台/空闲状态下运行,不会减慢其他功能,然后vmtouch将程序的数据映射到 RAM 中。

相关内容