为了提高性能,推荐的安装 Perl 的方法是什么?

What is the recommended way to install Perl for performance?

我正在配置中寻找推荐的选项,以在具有大量硬件资源的 Linux CentOS6.6 64 位服务器上安装 Perl 以获得最佳性能。我正在使用 plenv。 我正在使用的命令:

plenv install -j 8 -Dcc=gcc $perl_to_install

我应该添加哪些 -O 选项(和其他选项)?

我应该使用线程化 Perl 吗?

“Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.”

— Donald Knuth

您需要知道哪些选项与代码中的瓶颈相关

您应该编写代码,使其运行,然后使用 Devel::NYTProf 对其进行分析。只有这样你才能理智地问一个关于如何最好地重新配置 perl 解释器本身的问题