[英]calling perl script with system VS implementing package
Let me start with giving an example of what I'm dealing with first: 让我开始举例说明我首先要处理的事情:
I often call existed Perl scripts from previous engineers to process some data, and then proceed further with my script. 我经常调用以前的工程师提供的现有Perl脚本来处理一些数据,然后进一步处理我的脚本。 I either use
system
or back-ticks
to call other people scripts within my script. 我可以使用
system
调用或back-ticks
在脚本中调用其他人的脚本。
Now, I'm wondering if I rewrite those scripts as packages and use require
or use
to include those packages in my script, will it increase the processing speed? 现在,我想知道是否将那些脚本重写为包,并使用
require
或use
将这些包包含在我的脚本中,这会提高处理速度吗? How big of a difference would it be? 会有多大的不同?
Benefits: 优点:
perl
, compile the script and the module it uses. perl
,编译脚本及其使用的模块所需的时间。 That's a couple of seconds minimum , but it could be much larger. Downsides: 缺点:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.