Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Populating Treeview from Datastore - Speed Issue

7 posts in Objects Last posting was on 2002-07-15 18:51:16.0Z
Jason Lipman Posted on 2002-06-27 14:22:45.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Jason Lipman" <Jason.Lipman@state.sd.us>
Subject: Populating Treeview from Datastore - Speed Issue
Date: Thu, 27 Jun 2002 09:22:45 -0500
Lines: 14
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 164.154.9.183
Message-ID: <364_yZv9jeeHCHA.196@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1151
Article PK: 713714

Are there any tricks to improving the speed in which a Treeview gets
populated from a datastore? I have upwards of 9,300 rows to loop through of
active personnel to place in level 2, and I was hoping to not need to create
deeper levels (ie: alphabet, or something).

The Datastore is fairly quick, but the looping to create the Treeview is too
slow and impractical to use in my current scenario. I am currently in 6.5,
but hope to migrate to 8.x in the next month or so.

Thanks,

Jason Lipman


no_spamkkennedy Posted on 2002-07-15 18:51:16.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: no_spamkkennedy@grainscanada.gc.ca
Date: Mon, 15 Jul 2002 14:51:16 -0400
Subject: Re: Populating Treeview from Datastore - Speed Issue
Lines: 12
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_C85CFA7DE64EF2280067923785256BF7.0052B91C85256BE5@webforums>
References: <364_yZv9jeeHCHA.196@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:1114
Article PK: 713682

You said that the 9,300 employees are in level 2. Assuming that level 1 is
departments or whatever, populate the level 2 items only on demand.

If you add code to the item populate event and set the haschildren value to
true for level 1, then the matching second level is only retrieved the
first time the first level item is clicked upon.

This way when the window opens you just populate level 1 of the treeview.

HTH

karen kennedy


Philip_Salgannik Posted on 2002-06-27 16:03:10.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Philip_Salgannik
Date: Thu, 27 Jun 2002 12:03:10 -0400
Subject: Re: Populating Treeview from Datastore - Speed Issue
Lines: 4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_B16E63FAB9A6E10100582E4385256BE5.0052B91C85256BE5@webforums>
References: <364_yZv9jeeHCHA.196@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:1147
Article PK: 713710

Although 9K items in a treeview does not seem to be a very practical thing
as far as user perspective goes, it is not that high a number for a loop,
are you turning the redraw of the treeview off? Are you doing anything else
in that loop?


Philip_Salgannik Posted on 2002-06-27 16:03:10.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Philip_Salgannik
Date: Thu, 27 Jun 2002 12:03:10 -0400
Subject: Re: Populating Treeview from Datastore - Speed Issue
Lines: 4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_280A22AABF86C53C00582E2885256BE5.0052B91C85256BE5@webforums>
References: <364_yZv9jeeHCHA.196@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:1148
Article PK: 713711

Although 9K items in a treeview does not seem to be a very practical thing
as far as user perspective goes, it is not that high a number for a loop,
are you turning the redraw of the treeview off? Are you doing anything else
in that loop?


Jason Lipman Posted on 2002-06-27 20:50:55.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Jason Lipman" <Jason.Lipman@state.sd.us>
Subject: Re: Populating Treeview from Datastore - Speed Issue
Date: Thu, 27 Jun 2002 15:50:55 -0500
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 164.154.9.183
Message-ID: <364_YBWVe3hHCHA.654@forums.sybase.com>
References: <364_yZv9jeeHCHA.196@forums.sybase.com> <364_280A22AABF86C53C00582E2885256BE5.0052B91C85256BE5@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1145
Article PK: 713705

It's a simple loop. SetRedraw is set to False. The loop populates Label and
Data, then populates the treeview.

// Get data
ll_rowcount = iuo_ds.Retrieve(gs_user_id, is_status, ls_alpha)

// Loop through Datastore and populate Treeview
FOR ll_row = 1 to ll_rowcount
// Populate level 3, the people under the selected alpha
tvi_users.Label = iuo_ds.GetItemString(ll_row, 'name')
tvi_users.Data = iuo_ds.GetItemString(ll_row, 'ssn')
ll_rtn = This.InsertItemLast(handle, tvi_users)
NEXT

Jason

<Philip_Salgannik> wrote in message
news:280A22AABF86C53C00582E2885256BE5.0052B91C85256BE5@webforums...
> Although 9K items in a treeview does not seem to be a very practical thing
> as far as user perspective goes, it is not that high a number for a loop,
> are you turning the redraw of the treeview off? Are you doing anything
else
> in that loop?


Bug Posted on 2002-06-27 14:37:51.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Bug" <fenterbug@hotmail.com>
Subject: Re: Populating Treeview from Datastore - Speed Issue
Date: Thu, 27 Jun 2002 09:37:51 -0500
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
NNTP-Posting-Host: 206.66.2.100
Message-ID: <364_DZZQ$meHCHA.290@forums.sybase.com>
References: <364_yZv9jeeHCHA.196@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1150
Article PK: 713713

PB8 is reported to have a 20% to 30% performance increase.

I don't think there's anything you can do to your code to speed up the
creation of 9k TreeViewItems. You probably would do best to create deeper
levels. That would let you break up the item creation into smaller chunks.
(Doesn't make it faster, but makes the customer think it is.)

Alternatively, you could use a datawindow instead of a treeview. It'll take
some work to get it to act like a treeview, but they performance gain may be
worth it. I think the example application has an example.

"Jason Lipman" <Jason.Lipman@state.sd.us> wrote in message
news:yZv9jeeHCHA.196@forums.sybase.com...
> Are there any tricks to improving the speed in which a Treeview gets
> populated from a datastore? I have upwards of 9,300 rows to loop through
of
> active personnel to place in level 2, and I was hoping to not need to
create
> deeper levels (ie: alphabet, or something).
>
> The Datastore is fairly quick, but the looping to create the Treeview is
too
> slow and impractical to use in my current scenario. I am currently in 6.5,
> but hope to migrate to 8.x in the next month or so.
>
> Thanks,
>
> Jason Lipman
>
>


Jason Lipman Posted on 2002-06-27 14:48:43.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Jason Lipman" <Jason.Lipman@state.sd.us>
Subject: Re: Populating Treeview from Datastore - Speed Issue
Date: Thu, 27 Jun 2002 09:48:43 -0500
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 164.154.9.183
Message-ID: <364_kFhoEteHCHA.196@forums.sybase.com>
References: <364_yZv9jeeHCHA.196@forums.sybase.com> <364_DZZQ$meHCHA.290@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1149
Article PK: 713712

Good advise regarding the datawindow method! Thanks.

Jason

"Bug" <fenterbug@hotmail.com> wrote in message
news:DZZQ$meHCHA.290@forums.sybase.com...
> PB8 is reported to have a 20% to 30% performance increase.
>
> I don't think there's anything you can do to your code to speed up the
> creation of 9k TreeViewItems. You probably would do best to create deeper
> levels. That would let you break up the item creation into smaller chunks.
> (Doesn't make it faster, but makes the customer think it is.)
>
> Alternatively, you could use a datawindow instead of a treeview. It'll
take
> some work to get it to act like a treeview, but they performance gain may
be
> worth it. I think the example application has an example.
>
>
> "Jason Lipman" <Jason.Lipman@state.sd.us> wrote in message
> news:yZv9jeeHCHA.196@forums.sybase.com...
> > Are there any tricks to improving the speed in which a Treeview gets
> > populated from a datastore? I have upwards of 9,300 rows to loop through
> of
> > active personnel to place in level 2, and I was hoping to not need to
> create
> > deeper levels (ie: alphabet, or something).
> >
> > The Datastore is fairly quick, but the looping to create the Treeview is
> too
> > slow and impractical to use in my current scenario. I am currently in
6.5,
> > but hope to migrate to 8.x in the next month or so.
> >
> > Thanks,
> >
> > Jason Lipman
> >
> >
>
>