falinf has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm compiling up a perl only to be used for embedding in C software on the linux platform. Been looking around trying to see if I can find anything on ways to optimze the perl compiled for this use.

So far I'm thinking to disable threading but don't have much else planned as far as optimizing it. In a nutshell, the embedded interpreter will essentially be running code that pulls in a few modules, does some things with passed strings and ultimately returns a string.

If anyone has any optimization suggestions I'd love to hear them.

cheers!
  • Comment on Ways to optimize perl compile that's only to be used for embedding?

Replies are listed 'Best First'.
Re: Ways to optimize perl compile that's only to be used for embedding?
by Your Mother (Archbishop) on May 28, 2014 at 15:33 UTC

    I worked on a Perl app in Win that needed to be very small to be an enticing download/applet. One of the things we did was to build it without most core libs and without Unicode support in particular; the character DBs are quite large. Can't remember how big specifically but taking it out made the install much smaller. I'm a crummy build engineer, other team member handled that, so I can't walk you through it. :|

Re: Ways to optimize perl compile that's only to be used for embedding?
by Anonymous Monk on May 28, 2014 at 11:43 UTC

    If you want to optimize, that means that you have a performance (speed, size, ...) problem, right? What is the performance problem? If you don't have one, don't perform premature optimization :-)

Re: Ways to optimize perl compile that's only to be used for embedding?
by locked_user sundialsvc4 (Abbot) on May 28, 2014 at 13:08 UTC

    Exactly so.   First, what exactly does “optimize” mean, to you, in this situation.   And then, second, why do you care?   (The latter is meant as a serious question.)   Taking a step back from this requirement, what exactly differentiates this requirement from an ordinary application of XS?   Perl packages make use of low-level C/C++ modules more-or-less all the time.   How is this different?

    I suggest that you append a comment to this thread (please don’t change the original post) in which you elaborate on what you said about “in a nutshell.”   Your thoughts have obviously gone a very long way down one particular path, whereas when I read your brief description from an outsider’s point of view I’m not sure why this path was taken nor why exactly you concluded that one must do what you are now attempting to do.   I graciously presume that there is a reason and that you are entirely right.   But I can’t see it yet.   Therefore, kindly clarify.   What, exactly, is “going down” here?   Where are you coming from, and to where are you bound?