Major improvement potential in embedded perl

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
makre
Posts: 1
Joined: Fri Feb 03, 2017 2:36 am

Major improvement potential in embedded perl

Post by makre »

When the major part of the perl script's execution time is in loading modules, the embedded perl interpreter doesn't provide any noticeable performance benefit. I have some scripts that spend 99% of the time in 'use Whatever::Module', and would like to speed them up by loading the needed modules beforehand.

So, the question is: Is there any way to load modules into the interpreter, and then access them from the embedded plugin?

This would make the embedded interpreter MUCH more useful. The best would be if the p1.pl script could automagically get the needed module names from the plugin, and load them into the plugin's scope...
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Major improvement potential in embedded perl

Post by mcapra »

That would make a lot of sense, but i'm not sure how much "doing" it would require. You could probably parse out the perl plugins you're using by looking at Nagios command definitions, then identify the modules the script requires. I don't *think* the embedded interpreter would attempt to load the module twice. Or the embedded interpreter could ignore those stages.

GitHub is really the best place for this sort of discussion. I'd suggest bringing this up on the GitHub page (or I can on your behalf, if you don't have an account):
https://github.com/NagiosEnterprises/nagioscore
Former Nagios employee
https://www.mcapra.com/
Locked