[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] COBOL as Perl



>>>>> "JP" == John Porter <jdporter@min.net> writes:

JP> Brand wrote:
>> 
>> However, while this version looks more "perlish", it's not as
>> efficient.  There's the temp copy of $left_key, the loop exit test
>> each time through the loop, and an extra test when $left_key is less
>> than $right_key.

JP> Also note that if one stream is much longer than the other, some
JP> performance gain can be had be detecting when one stream runs out,
JP> and just processing the remainder of the other stream, without any
JP> comparisons.

The trade-off is between, code complexity (two other copy of a control-loop)
vs. the minor cost of comparisons vs. the I/O overhead.

I've usally decide in favor of a single control loop. I hate having
nearly identical pieces of code.

<chaim>
-- 
Chaim Frenkel					     Nonlinear Knowledge, Inc.
chaimf@pobox.com				               +1-718-236-0183

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe