1

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. I either use system or back-ticks to call other people scripts within my script.

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? How big of a difference would it be?

1 Answer 1

2

Benefits:

  • It would save the time taken to load the shell, load perl, compile the script and the module it uses. That's a couple of seconds minimum, but it could be much larger.
  • If you had to serialize data to pass to the child, you also save the time taken to serialize and deserialize the data.
  • It would allow more flexible interfaces.
  • It would make error handling easier and more flexible.

Downsides:

  • Since everything is now in the same process, the child can have a much larger effect on the parent. e.g. A crash in the child will take down the parent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.