Benchmarking 'table-loading' experience to share ...

Discussions about design and architecture principles, including native JADE systems and JADE interoperating with other technologies
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Benchmarking 'table-loading' experience to share ...

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:15 am

by Silver Springs ... >> Sun, 10 Oct 1999 22:23:29 GMT

Hi
I spent this morning optimising the loading of a table in my application to try and get better performance.

I use tables as my main interface for users selecting an instance to work with.

Having defined the columns required and set the text of the column headers (in row 1 - a fixed row) then I created a loop that generated some numbers and put them into 11 columns of each row.

A popular way (Way#1) of loading a table row (as done by default using the Form Wizard with tables) is to directly set the column # of each cell and then assign the appropriate text into each column cell e.g.

tbl_Test.column := 1;
tbl_Test.text := tbl_Text.row.String;
tbl_Test.column := 2;
tbl_Test.text := (tbl_Text.row+tbl_Test.column).String;
tbl_Test.column := 3;
tbl_Test.text := (tbl_Text.row+tbl_Test.column).String;
..... etc for all defined columns .............

Another way (Way#2) is to load the whole row at once rather than each individual table cell. This is more efficient and the savings can be substantial (see below). Your code would look something like :

tbl_Test.addItem(tbl_Text.row.String & Tab &
(tbl_Text.row+tbl_Test.column).String & Tab & (tbl_Text.row+tbl_Test.column+1).String & Tab & (tbl_Text.row+tbl_Test.column+2).String & Tab & ..... etc for all defined columns .............
(tbl_Text.row+tbl_Test.column+9).String);

When you put Way#2 into a called method then the results are as shown below.

Putting Way#2 directly into the loop generating the data (Way#3) reduces the calls to a separate method and gives even more time savings.

Hence I'm changing to Way#3 from now on.

Any comments as to further improve table-loading performance ????????????????

My benchmarking with 11 columns :

1000 rows 10000 rows
16000 rows (16000 max.in table allowed) ____________________________________________________________________________ _______
Way#1 4 secs 53 secs
103 secs
column-by
column defn.

Way#2 addItem 3 secs 30 secs
65 secs
in called method

Way#3 addItem 2 secs 29 secs
62 secs
directly in loop


SilverSprings ............................... silversprings@easyliving.com

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Benchmarking 'table-loading' experience to share ...

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:15 am

by Darrell Duniam >> Sun, 10 Oct 1999 22:58:06 GMT

Furthermore, adding a (tab-delimited) row to a table in one hit, rather than setting the text of one cell at a time, is particularly significant for thin clients - the network traffic greatly is reduced.

darrell.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Benchmarking 'table-loading' experience to share ...

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:15 am

by Torrie Moore >> Sun, 10 Oct 1999 23:13:29 GMT

We have noticed the same performance issues. We were using a displayCell method on a table with a collection attached. As each item was added to the table the displayCell methd was called for each cell. This was quite slow as other method calls were involved. We have rewritten the table to use a displayRow method for each item. This sped up the loading of the table significantly. We have written the table to only display as many items in the grid as there are rows in the table. At present the table has no veritcle scroll bar and the user must use arrowkeys, page down / up etc to navigate the table. We are using this table over a 60000 collection with good performance. (I don't have exact numbers sorry.)

Torrie Moore
Concept Engineering


Return to “Design and Architecture”

Who is online

Users browsing this forum: No registered users and 12 guests