Fellow Monger Experts;

I have something that works but the timing is just tooooooo slow. I have a subroutine that communications with remote hosts. It simply passes a one line string as a request and receives back from 1 to 100+ lines of text in return.

As this is done as a subroutine I am returning the total response as one string. Most likely this is where the sluggishness occurs.

In my test the host program is logging just under three seconds to process the request and return about 12K bytes (100 lines of 115 bytes).

However, when timing the snippet below, it takes over 12 seconds to complete. That's 8 seconds (and that's an eternity) to respond.

My guess is that either the method of concatenating the returned records to the string $RECIN is slower than fudge in Alaska.

Perhaps some of you can recommend a method that will either
1) allow the construction of the string to be returned in a much more efficient manner, or
2) recommend by example a better and much more efficient method of returning the data to the calling script.


Either way, I would appreciate hearing from any of you who have experienced this type of problem.

Thanks in advance to all my fellow mongers out there.

Bob - Hartford PM

---subrouting snippet---

#######################################################
# Send Request to host
open(CXIBIO,"+<$ARGV[0]") or die "Could NOT open $ARGV[0]\n";
print CXIBIO "$ARGV[1]\015";
# Get Response from host
EP0000: while (1) {                                                     
$REC="";
$REC=<CXIBIO>;
# Bypass ALL Returned Records until "Beginning of Data Sequence"
if ( $REC =~ m/[EMAIL PROTECTED]/) { next EP0000; }
# Exit if Last Record Signal
if ( $REC =~ m/^0999/)  { last EP0000; }
# Contruct Host Response String
$RECIN="$RECIN"."$REC";
}
print "$RECIN\n";
close(CXIBIO);
#######################################################

email: [EMAIL PROTECTED]

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to