× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Steve,

>From my tests, you're correct.   If the current length of the varying
string is only 10, it should only copy 10 bytes to the procedure it calls,
even if the potential length is as large as 32000.

It probably still needs to allocate 32000 bytes of memory, but I don't
really understand why that would slow it down so much.  Maybe one of the
IBMers can explain?

I see no logical reason to believe that null-terminated strings would be
any faster.  Though, you don't normally pass null-terminated strings by
value, so it's hard to compare.



On Wed, 9 Oct 2002, Steve Richter wrote:

>
> -----Original Message-----
> From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On
> Behalf Of Scott Klement
> Sent: Wednesday, October 09, 2002 12:09 AM
> To: chat. Rpg400-L
> Subject: Re: timings II. const varying vs value varying
>
> >However, when something is passed "value" it has to make a copy of the
> >entire variable.
>
> >So, logically, it will take longer to pass something large by value
> >than it would by const.   i.e. copyying 16 bytes is faster than copying
> >32,000.
>
>  d  sText1         d        32000 a  varying
>  d  sText2         d        32000 a  varying
>  c                eval  sText1 = sText2
>
> only the length of sText2 is copied to sText1.  not the 32000 size of
> sText2.
>
> Based on what Hans said the other day, ILE doesnt know varying. So I guess
> ILE copies the entire value, not knowing that the data is a varying string.
>
> I dont know how to work with null term strings in RPG but am interested in
> knowing if they would pass and return better in ILE than varying length
> strings.
>
> Steve Richter
>



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.