Reusable Part in List is slow

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Reusable Part in List is slow

Post by atostaine »

We have a VL-WEB App with about 1200 lines in a list. Performance was fine. We removed 12 columns and made 1 new column with an RP that just shows the values in a stacked format instead of across.

The performance is terrible. Even scrolling the list is slow. Any tips on how to speed up the RP being displayed?

Thanks
Art Tostaine
User avatar
Dino
Posts: 477
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Reusable Part in List is slow

Post by Dino »

Hi Art

Are you using tiles for this? Using standard tiles, I get less than 3 seconds in an i5 processor notebook to prepare a list of tiles with components, no much difference if reading a database or just using localdata (no server module).

For example, this is my webpage (TE819WP):

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<MaterialDesignBlue>)

Define_Com Class(#PRIM_TBLO) Name(#LayoutList)
Define_Com Class(#PRIM_TBLO.Column) Name(#LayoutListColumn1) Displayposition(1) Parent(#LayoutList)
Define_Com Class(#PRIM_TBLO.Row) Name(#LayoutListRow1) Displayposition(1) Parent(#LayoutList)

Define_Com Class(#PRIM_TILE<#te819cell>) Name(#Tile) Displayposition(1) Left(24) Parent(#COM_OWNER) Tabposition(1) Top(184) Height(616) Width(1176)
Define_Com Class(#PRIM_MD.Label) Name(#Text) Caption('Title') Displayposition(2) Height(45) Left(3) Parent(#COM_OWNER) Tabposition(2) Themedrawstyle('Title') Top(88) Width(1166)
Define_Com Class(#PRIM_MD.FlatButton) Name(#Button) Caption('Test with localdata') Displayposition(3) Left(45) Parent(#COM_OWNER) Tabposition(3) Themedrawstyle('Borders1+BorderTheme500+ForegroundMediumPrimary+Rounded') Top(16) Width(204)
Define_Com Class(#PRIM_MD.RaisedButton) Name(#Button1) Caption('Test with Database Data') Displayposition(4) Left(264) Parent(#COM_OWNER) Tabposition(4) Themedrawstyle('MediumTitle+Rounded') Top(16) Width(212)

Define Field(#startime) Reffld(#datetimex)

Evtroutine Handling(#Button.Click)
#COM_OWNER.localdata
Endroutine

Mthroutine Name(localdata)
Clr_List Named(#Tile)
#startime := #datetimex.now
#empno := A0001
#surname := PEREZ
#givename := JUAN
Inz_List Named(#Tile) Num_Entrys(1200)
#empno := A0004
#surname := GOMEZ
#givename := MARTINA
Add_Entry To_List(#Tile)
#Text := 'Time used localdata ' + (#datetimex.now.AsSeconds - #startime.AsSeconds).AsString + ' seconds.'
Endroutine

Evtroutine Handling(#Button1.Click)
#COM_OWNER.readingdata
Endroutine

Mthroutine Name(readingdata)
Define_Com Class(#PSLMST30.FindAll) Name(#FindAll)
#startime := #datetimex.now
#FindAll.ExecuteAsync Pslmstlist(#Tile)
Evtroutine Handling(#FindAll.Completed)
#Text := 'Time used database ' + (#datetimex.now.AsSeconds - #startime.AsSeconds).AsString + ' seconds.'
Endroutine
Endroutine
End_Com
and this my tile reusable part (TE819CELL) for the tile:

Code: Select all

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_PANL *implements #Prim_Tile.iTileDesign *ListFields #ListFields) Displayposition(1) Height(249) Left(0) Tabposition(1) Top(0) Width(456)

Group_By Name(#ListFields) Fields(#EMPNO #SURNAME #GIVENAME)

Define_Com Class(#PRIM_PANL) Name(#ImagePanel) Displayposition(1) Height(97) Image(#xImageLANSA2015) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(0) Width(181)

Define_Com Class(#EMPNO.Visual) Name(#EMPNO) Componentversion(1) Displayposition(2) Height(77) Left(181) Parent(#COM_OWNER) Tabposition(2) Top(20) Usepicklist(False) Width(275) Marginleft(0)
Define_Com Class(#SURNAME.Visual) Name(#SURNAME) Displayposition(3) Left(181) Parent(#COM_OWNER) Tabposition(3) Top(97) Marginleft(0) Height(76) Width(275)
Define_Com Class(#GIVENAME.Visual) Name(#GIVENAME) Displayposition(4) Left(181) Parent(#COM_OWNER) Tabposition(4) Top(173) Marginleft(0) Height(76) Width(275)
Define_Com Class(#PRIM_CKBX) Name(#CheckBox1) Caption('CheckBox1') Displayposition(5) Left(46) Marginleft(2) Parent(#COM_OWNER) Tabposition(5) Top(111) Height(24) Width(89)
Define_Com Class(#PRIM_PHBN) Name(#Button1) Caption('Button1') Displayposition(6) Left(50) Parent(#COM_OWNER) Tabposition(6) Top(135) Height(24)
Define_Com Class(#PRIM_MD.Icon) Name(#Icon) Displayposition(7) Icon('account_circle') Left(66) Parent(#COM_OWNER) Tabposition(7) Top(187)
End_Com
My server module (PSLMST30) has been modified to read 30 times the PSLMST table, as I only have 40 records there:

Code: Select all

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_SRVM)
Def_List Name(#PSLMSTList) Fields(#EMPNO #SURNAME #GIVENAME #ADDRESS1 #ADDRESS2 #ADDRESS3 #POSTCODE #PHONEHME #PHONEBUS #DEPTMENT #SECTION #SALARY #STARTDTE #TERMDATE #MNTHSAL) Counter(#ListCount) Type(*WORKING) Entrys(*MAX)

Srvroutine Name(FindAll)
List_Map For(*OUTPUT) List(#PSLMSTList)

Begin_Loop To(30)
Select Fields(#PSLMSTList) From_File(PSLMST)
Add_Entry To_List(#PSLMSTList)
Endselect
End_Loop
Endroutine
End_Com
and here a couple of screen shots of the results:
testlocaldata.jpg
testlocaldata.jpg (147.15 KiB) Viewed 34446 times
testdb.jpg
testdb.jpg (147.23 KiB) Viewed 34446 times
How this code performs in your computer? How this compares with the code you are using?
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Reusable Part in List is slow

Post by atostaine »

Hi DIno: Thanks for the reply. My main component is a List, and I have a reusable part in each row. My RP Was a *CELL but I changed to tile, I didn't see any improvement.

Do you think I should just use tiles and add Column 1,2, and 3 to my tile?
My list is like this:

Column1 Column2 Column3 column 4 (RP)
xxxxx xxxxxx xxxxxxxx xxx xxx xxx
xxx xxx xxx
xxx xxx xxx
xxx xxx xxx

xxxxx xxxxxx xxxxxxxx xxx xxx xxx
xxx xxx xxx
xxx xxx xxx
xxx xxx xxx

xxxxx xxxxxx xxxxxxxx xxx xxx xxx
xxx xxx xxx
xxx xxx xxx
xxx xxx xxx
Art Tostaine
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

Re: Reusable Part in List is slow

Post by BrendanB »

Art,

2 ways to fix this:

1. use a #PRIM_MD.List or #PRIM_TREE (you can still set a layout for the 'item' which can have fixed columns, and put a panel on top for the headings that uses same sort of layout.
2. continue to use a #PRIM_LIST, but instead of using a RP, stack rows differently:

eg:

Column1 Column2 Column3 HiddenCol
Row1 Row1 Row1 Entry1
Row2
Row3
Row4
Row5 Row5 Row5 Entry2

This gets trickier to figure out (as you are putting out 'extra' lines.... but it does work.

I personally think if you need to 'stack' the items, it is best to use a #PRIM_TREE or #PRIM_MD.List..... (a #PRIM_MD.List is like a #PRIM_TREE without you creating the design as a seperate part).

I have used all 3 of these to effect with very large lists...

Brendan.
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Reusable Part in List is slow

Post by atostaine »

Im trying the list with handling the rows myself. How do I hide the first 5 columns?

I’ve tried cellheight := 0 with cell sizing set to none. I’ve tried cellvisible := none. Nothings working.
Art Tostaine
User avatar
Dino
Posts: 477
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Reusable Part in List is slow

Post by Dino »

This work for me in the reusable part with the tile:

Code: Select all

Mthroutine Name(OnAdd) Options(*REDEFINE)
If (#EMPNO.RightMost( 1 ) > '4')
#CheckBox1.visible #button1.visible #icon.visible #surname.visible #givename.visible := False
#COM_OWNER.Height := 100
Endif
Endroutine
then I get this result:
testdb2.jpg
testdb2.jpg (109.96 KiB) Viewed 34424 times
kno_dk
Posts: 221
Joined: Tue Feb 23, 2016 12:00 am

Re: Reusable Part in List is slow

Post by kno_dk »

Hi.

I have struggled with performance on a list - PRIM_MD.List. I have to show 500 entries and it took between 7,5 sec to 14,5 sec.
Getting the data from the servermodule was less than 0,5 sec. so more than 7 sec to build the list.

I have now changed the view to use a list of tiles as described in the post from Dino. And now it only takes around 1 sec to show the information. :D

I hope LANSA will work on the performance on the PRIM_MD.List as it have some nice features like pageing

/Klaus
Post Reply