Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Minimizing PAR performance hit

by gaal (Parson)
on Jan 08, 2007 at 11:16 UTC ( [id://593514]=note: print w/replies, xml ) Need Help??


in reply to Re: Minimizing PAR performance hit
in thread Minimizing PAR performance hit

Thanks for the input.

One thing I have since noticed, sorting included files by size, is that Math::Pari comes with a huge 6MB shared object! This is bad enough, though not of course PAR's fault; but it is made worse by the fact that I have several instances of my program running and apparently an .so embedded this way cannot be shared. So the effective difference between a PARed and unPARed version of my program is dramatic indeed.

In my case, I might be able to get Math::Pari deployed separately. I think adding "look for large shared objects" can go in the FAQ, which is indeed otherwise useful.

Replies are listed 'Best First'.
Re^3: Minimizing PAR performance hit
by fizbin (Chaplain) on Jan 08, 2007 at 16:32 UTC
    Given that, it may also be worth posting a separate SOPW question about what you're doing that requires Math::Pari. There may be other ways to do it that would involve modules without nearly as much baggage.
    --
    @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/
      I use Net::SSH::Perl, which relies on Crypt::DSA, which in turn uses Math::Pari. This last isn't strictly required... so long as you don't mind 30-second-long login times to SSH servers. :-(

      Regardless, the RAM overhead of PAR seems to be about 8-9MB...

        Well, so long as you must use Net::SSH::Perl, yes, you're bound to PARI. I'll note though that from what hints you've provided about your execution environment, you aren't in a situation where you'd really be taking advantage of Net::SSH::Perl's main advantage, which is that you don't have to create an extra process in order to ssh - this is a boon in a long-running perl process that will ssh frequently, or on a system with a high per-process overhead (such as windows). You don't seem to be in such a situation.

        Could you also accomplish what you need to accomplish by using the ssh command-line client already there on the machine you're going to be running on and using Net::SSH, IPC::Open3, or possibly even Expect?

        (Note that Expect comes with its own shared-library baggage, but likely less than Pari's)

        --
        @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/
Re^3: Minimizing PAR performance hit
by tsee (Curate) on Jan 08, 2007 at 12:35 UTC

    Wow, 6MB is quite a shared object!

    By the way, what do you mean by "cannot be shared"? Can't be shared in the concept of shared memory? Does that work if the instances run in separate perl's? If so, I wonder why this doesn't happen if you run the same par'd binary twice because the cache area should be the same. Does it, perhaps, help to put Math::Pari into a separate .par and using that? Try fiddling with the $ENV{PAR_GLOBAL_TEMP} variable to force sharing of the cache directory. And please forgive me for hand-waving. :)

    On a related note: If you download the PAR-0.970.tar.gz distribution and look for the pare utility in the contrib/ subdirectory, you'll find a tool to remove all common modules from one executable and make it depend on the other. I'm not sure it works for the dependency on a .par. But perhaps pp -X foo.par works by skipping the stuff in foo.par during packaging!

    If you plan to deploy Math::Pari to the target system(s), you can use a .par as well - if you like. Here, I would advise a slightly different process:

    • use PAR::Dist::FromCPAN's cpan2par tool to create a Math-Pari-VERSION-PLATFORM-PERLVERSION.par binary from Math::Pari
    • Ship that to the clients
    • Have them install that binary with perl -MPAR::Dist -einstall_par (assuming only one .par in the current directory. See PAR::Dist.)
    You can even embed PAR::Dist into a simple "install_par.pl" script since it's pure-perl without non-core dependencies.

    About your suggestion for the FAQ: Would you mind editing the wiki yourself? Just modify the existing answer or, if you like, create a new Q/A pair. Thanks!

    Steffen

      Yes, IIRC none of the running instances of my program had very large Shared parts in their memory usage. I won't be at this particular $client's till Wednesday but I'll double check then. (Thanks for the wiki tip; I will certainly update the FAQ there if my hypothesis is confirmed.)

      The system is CentOS, but that doesn't have RPMs for any of the PAR utils (including PAR::Dist). Since PAR is meant to help with the bootstrapping problem of weakling perl installs, it'd be awesome if all major distros got one -- I'll see if what I can do in a couple of days :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://593514]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found