Studio 6.x - $sendall very slow? (fixed length lists)
Mike Matthews
omnis at lineal.co.uk
Thu Feb 2 11:10:00 EST 2017
Well I'll be! Still learning!!
I seem to recall a switch between making it long or fixed, was that Omnis 5 or 7v1 maybe?
Such a long time ago.....
Mike
(For once, silenced)
> On 2 Feb 2017, at 15:42, Doug Easterbrook <doug at artsman.com> wrote:
>
> hi Nick.
>
> it goes back away, but in omnis 7 you could do something like
>
> define list first_name/20.last_name/100,flag1,flag23,int1,big_char/300
>
>
> the /20 after first_name told omnis to reserve 20 characters of space, regardless of the actual length of the field or the contents of the field
>
>
>
> so sticking ‘nick’ into the list would be ‘nick + 16 spaces’ for a total of 20 characters.
>
>
> This addressed the problem of unpacking and repacking a list and shifting it in memory — because the length of the character string was always 20.
>
>
> this could make things faster in omnis 7. it could also kill you if you changed the file class and made first_name as 30 characters. you’d have to go change your code everywhere.
>
>
>
>
> reading the studio 5.2 documentation — its still there — but I don’t think it applies to smart lists and $defineFromSqlClass — only useful for memory lists
>
> ; VariableName/N. For example to use only the first 10 characters
> of the variable iCol3Char in column 3
> Define list {iCol1Date,iCol2Num,iCol3Char/10}
>
>
>
>
>
> Doug Easterbrook
> Arts Management Systems Ltd.
> mailto:doug at artsman.com
> http://www.artsman.com
> Phone (403) 650-1978
>
>> On Feb 2, 2017, at 6:49 AM, Nick Renders <omnis1 at arcict.com> wrote:
>>
>> To expand on Doug's method to add lines to a new list (point 2):
>> we do this as well, using a temporary Row variable instead of the CRB.
>>
>> Here's an example:
>>
>> ; ** lList1 is filled with data
>> Do lList2.$copydefinition(lList1)
>> Do lRow.$copydefinition(lList1)
>> For lList1.$line from 1 to lList1.$linecount step 1
>> Do lRow.$assignrow(lList1)
>> ; ** calculate some columns in lRow
>> Do lList2.$merge(lRow)
>> End For
>>
>>
>> By the way Doug, what is this Omnis 7 fixed length list?
>> I spent my fair share of time in Omnis 7, but it doesn't ring a bell.
>>
>> Nick
>>
>>
>>
>> On 1 Feb 2017, at 22:14, Doug Easterbrook wrote:
>>
>>> hi andrew.
>>>
>>> we learned this the hard way a number of years ago.
>>>
>>>
>>> the performance issue, plain and simple, is what omnis needs to to to unpack/replace/pack the list. it shuffles memory as other point out and it does it one line at a time.
>>>
>>> if the items are at the beginning of the list, there is more memory to shuffle.
>>>
>>> The best approaches:
>>>
>>>
>>> 1) if the data is coming from a sql database, set the date properly in sql first an never in omnis — so that the data comes and is not changed on omnis
>>>
>>>
>>> 2)-0r- process the list, change the data and COPY it to a new list so that you are always adding lines to the end of the NEW list. adding lines does not cause memory shuffling.
>>>
>>> 3) -or- find out how many lines match your problem and if its only one or two, change them. (doesn’t sound like there are one or two)
>>>
>>> 4) -or DO NOT CHANGE the data in the list — change it on display in a list with a pick statement.
>>>
>>> 5) -or- change the data with the same number of bytes. (eg, replace integer data with an integer, replace boolean with boolean, replace 4 text characters with 4 text characters, not 5 or not 3). the list is not extended in that case and it is the same number of bytes
>>>
>>> 6) -or- use the old omnis 7 era FIXED length lists — you can declare lists to be fixed size so they won’t expand and contract.
>>>
>>>
>>>
>>> unpacking and packing a list is the most expensive performance issue and should be avoided at all costs, unless lists are very small.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Doug Easterbrook
>>> Arts Management Systems Ltd.
>>> mailto:doug at artsman.com
>>> http://www.artsman.com
>>> Phone (403) 650-1978
>>>
>>> On Feb 1, 2017, at 10:01 AM, Andrew Stolarz <stolarz at gmail.com> wrote:
>>>
>>> Hello,
>>>
>>> In some cases we build a list of about 7000 rows and when I do a $sendall
>>> to replace the code for the "test" text, its painfully slow (10+ mins)
>>>
>>>
>>> Do iv_ActivityList.$sendall($ref.iv_Type.$assign('test'),$ref.iv_Type='740')
>>>
>>>
>>>
>>> Any recommendations on how to make this fast in Omnis?
>>>
>>>
>>>
>>> Andrew
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>>
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
More information about the omnisdev-en
mailing list