Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^5: Finding Usable Nodes in our Cluster

by jwkrahn (Abbot)
on Apr 12, 2008 at 01:12 UTC ( [id://679908]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Finding Usable Nodes in our Cluster
in thread Finding Usable Nodes in our Cluster

Is there any considerable speed advantage to using the string instead of the array? Or does it have to do with memory usage?

Using strings instead of arrays will definitely use less memory as each scalar has a certain amount of overhead so two strings vs. two arrays of strings will use less.   Another way to reduce memory usage is to use a piped open and read each line in a while loop.

As for speed, it depends on how much IO overhead is involved from reading the output of an external program.   But in general using strings should be faster than using arrays.   As always, if in doubt use Benchmark or one of the profilers to determine the speed differences.

This may also provide some help: When perl is not quite fast enough

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found