Anyone have any hints on improving the performance of C# UI? I'm filling a
TreeView and ListView with information returned by a SQLDataReader and
information read from the Registry. I'm working on improving the SQL Query
execution speed, but have no idea how to improve Registry-reading
performance or TreeView/ListView update speed. Any ideas appreciated.
Thanks,
Michael C. 8 3383
Michael C <mi*******@optonline.net> wrote: Anyone have any hints on improving the performance of C# UI? I'm filling a TreeView and ListView with information returned by a SQLDataReader and information read from the Registry. I'm working on improving the SQL Query execution speed, but have no idea how to improve Registry-reading performance or TreeView/ListView update speed. Any ideas appreciated.
Well, are you already doing the SQL/Registry querying in a separate
thread, and updating the TreeView/ListView within BeginUpdate/EndUpdate
sections? Those would be the first things to do.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Michael C wrote: Anyone have any hints on improving the performance of C# UI? I'm filling a TreeView and ListView with information returned by a SQLDataReader and information read from the Registry. I'm working on improving the SQL Query execution speed, but have no idea how to improve Registry-reading performance or TreeView/ListView update speed. Any ideas appreciated.
I'm not sure how big the dataset is but what really helps is not completely
filling the tree at once but per node, when they're expanded. This means that
you cache the data in a dataset or other bucket and add the child nodes to
the expanded node when the user expands a node.
Very easy to do and very efficient. Explorer for example does this too, it
would take ages to fill hte complete tree at the left.
Add a dummy node to every node which should have childs (and remove that
one when you expand the node) to be able to click it open.
FB
--
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
The BeginUpdate/EndUpdate I'm doing - although it doesn't seem to speed up
the UI any, it does seem to reduce flicker. I'm working on splitting out
the SQL/Registry querying in a separate thread right now, but there might be
a little problem with that. Do you know, if you were to issue a
long-running Non-Query command against a SQL Server, could it cause problems
if the program was terminated in the middle of command execution?
As an example, if you issued a "DROP INDEX 'table1.idx_index1'" command that
was taking 15-20 seconds to run, and in the middle you ended the program
could it cause database inconsistencies? Or would SQL Server keep chugging
along and complete the request? I want to find an answer on this before I
put my non-query SQL commands on separate threads.
Thanks,
Michael
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om... Michael C <mi*******@optonline.net> wrote: Anyone have any hints on improving the performance of C# UI? I'm
filling a TreeView and ListView with information returned by a SQLDataReader and information read from the Registry. I'm working on improving the SQL
Query execution speed, but have no idea how to improve Registry-reading performance or TreeView/ListView update speed. Any ideas appreciated.
Well, are you already doing the SQL/Registry querying in a separate thread, and updating the TreeView/ListView within BeginUpdate/EndUpdate sections? Those would be the first things to do.
-- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
One of the problems is that I don't know in advance how big the dataset is
either :( I'm testing all my code against two datasets - one we consider
"average" and a much, much larger one. I do have a well-defined structure
for my TreeView though, so I know exactly how many levels deep it needs to
be and exactly how the data will be grouped together. The dynamic node
filling is a very good idea. I'll have to work out some of the kinks as far
as 'synchronizing' (if that's the right word) the TreeView population with
the SQL queries on their separate thread.
I'm also playing with the idea of creating a new subclass or two of TreeNode
that expose some more properties I can use to get my SQL queries and node
fills in sync with one another. One property I'm working on is a "Level"
property that tells you which level a particular TreeNode is on - for
instance, the root node of the TreeView would be Level 0, it's immediate
children would be Level 1, etc., etc. What I've come up with as far as a
function is pretty useful, but I definitely don't want to re-invent the
wheel - is there a function or property out there that does this already?
All this brings up one more question (I'm about to test this myself) - do
you have to cast a subclass of TreeNode back to (TreeNode) in order to work
with it in a TreeView?
Thanks for the help,
Michael C. I'm not sure how big the dataset is but what really helps is not
completely filling the tree at once but per node, when they're expanded. This means
that you cache the data in a dataset or other bucket and add the child nodes to the expanded node when the user expands a node.
Very easy to do and very efficient. Explorer for example does this too,
it would take ages to fill hte complete tree at the left.
Add a dummy node to every node which should have childs (and remove that one when you expand the node) to be able to click it open.
FB
-- Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com My .NET Blog: http://weblogs.asp.net/fbouma Microsoft C# MVP
"Michael C" <mi*******@optonline.net> wrote in message
news:J2*********************@news4.srv.hcvlny.cv.n et... One of the problems is that I don't know in advance how big the dataset is either :( I'm testing all my code against two datasets - one we consider "average" and a much, much larger one. I do have a well-defined structure for my TreeView though, so I know exactly how many levels deep it needs to be and exactly how the data will be grouped together. The dynamic node filling is a very good idea. I'll have to work out some of the kinks as
far as 'synchronizing' (if that's the right word) the TreeView population with the SQL queries on their separate thread.
I'm also playing with the idea of creating a new subclass or two of
TreeNode that expose some more properties I can use to get my SQL queries and node fills in sync with one another. One property I'm working on is a "Level" property that tells you which level a particular TreeNode is on - for instance, the root node of the TreeView would be Level 0, it's immediate children would be Level 1, etc., etc. What I've come up with as far as a function is pretty useful, but I definitely don't want to re-invent the wheel - is there a function or property out there that does this already?
I use the ComponentOne flexgrid in treeview mode. It has a level property of
a node which is as you described(not that this helps you)
I cannot find anything in the standard ms treeview.
All this brings up one more question (I'm about to test this myself) - do you have to cast a subclass of TreeNode back to (TreeNode) in order to
work with it in a TreeView?
No.
Upcasting is performed implicitly.
HTH
JB
"Upcasting" Casting to a base class.
Personally I've always called it downcasting because the "base" is always on
the bottom, but from a hierarchical perspective, upcasting fits better. (See
later thread in this group :)
Thanks for the help, Michael C.
I'm not sure how big the dataset is but what really helps is not completely filling the tree at once but per node, when they're expanded. This means that you cache the data in a dataset or other bucket and add the child nodes
to the expanded node when the user expands a node.
Very easy to do and very efficient. Explorer for example does this
too, it would take ages to fill hte complete tree at the left.
Add a dummy node to every node which should have childs (and remove
that one when you expand the node) to be able to click it open.
FB
-- Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com My .NET Blog: http://weblogs.asp.net/fbouma Microsoft C# MVP
"Michael C" <mi*******@optonline.net> wrote in message
news:vP*********************@news4.srv.hcvlny.cv.n et... The BeginUpdate/EndUpdate I'm doing - although it doesn't seem to speed up the UI any, it does seem to reduce flicker. I'm working on splitting out the SQL/Registry querying in a separate thread right now, but there might
be a little problem with that. Do you know, if you were to issue a long-running Non-Query command against a SQL Server, could it cause
problems if the program was terminated in the middle of command execution?
As an example, if you issued a "DROP INDEX 'table1.idx_index1'" command
that was taking 15-20 seconds to run, and in the middle you ended the program could it cause database inconsistencies? Or would SQL Server keep
chugging along and complete the request? I want to find an answer on this before I put my non-query SQL commands on separate threads.
SQL server would keep "chugging" away until it finishes as the query/command
is "sent" to the server which then queues it and processes.
HTH
JB
Thanks, Michael
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message news:MP************************@msnews.microsoft.c om... Michael C <mi*******@optonline.net> wrote: Anyone have any hints on improving the performance of C# UI? I'm filling a TreeView and ListView with information returned by a SQLDataReader and information read from the Registry. I'm working on improving the SQL Query execution speed, but have no idea how to improve Registry-reading performance or TreeView/ListView update speed. Any ideas appreciated.
Well, are you already doing the SQL/Registry querying in a separate thread, and updating the TreeView/ListView within BeginUpdate/EndUpdate sections? Those would be the first things to do.
-- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
Michael C <mi*******@optonline.net> wrote: The BeginUpdate/EndUpdate I'm doing - although it doesn't seem to speed up the UI any, it does seem to reduce flicker. I'm working on splitting out the SQL/Registry querying in a separate thread right now, but there might be a little problem with that. Do you know, if you were to issue a long-running Non-Query command against a SQL Server, could it cause problems if the program was terminated in the middle of command execution?
If it did, I'd consider that a major flaw in SQL Server!
As an example, if you issued a "DROP INDEX 'table1.idx_index1'" command that was taking 15-20 seconds to run, and in the middle you ended the program could it cause database inconsistencies? Or would SQL Server keep chugging along and complete the request? I want to find an answer on this before I put my non-query SQL commands on separate threads.
I expect it would implicitly roll back the transaction, but I couldn't
say for sure. It certainly shouldn't screw up the db.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Thanks all for the help! I'm definitely going to put some of this to work
in this app!
Michael C.
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om... Michael C <mi*******@optonline.net> wrote: The BeginUpdate/EndUpdate I'm doing - although it doesn't seem to speed
up the UI any, it does seem to reduce flicker. I'm working on splitting
out the SQL/Registry querying in a separate thread right now, but there
might be a little problem with that. Do you know, if you were to issue a long-running Non-Query command against a SQL Server, could it cause
problems if the program was terminated in the middle of command execution?
If it did, I'd consider that a major flaw in SQL Server!
As an example, if you issued a "DROP INDEX 'table1.idx_index1'" command
that was taking 15-20 seconds to run, and in the middle you ended the program could it cause database inconsistencies? Or would SQL Server keep
chugging along and complete the request? I want to find an answer on this before
I put my non-query SQL commands on separate threads.
I expect it would implicitly roll back the transaction, but I couldn't say for sure. It certainly shouldn't screw up the db.
-- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: valexena |
last post by:
How can I improve performance of queries on tables containing all words
in the dictionary starting with the letter ‘S’?
--
Posted via http://dbforums.com
|
by: Jaidev Paruchuri |
last post by:
I have a table called work_order which has over 1 million records and a
contractor table which has over 3000 records.
When i run this query ,it takes long time since its grouping by
contractor...
|
by: Lakesider |
last post by:
Hi NG,
I have written an application with a lot of file- and database
operations. There are several algorithmic operations, too. My question
is: are ther any tools to improve performance
-...
|
by: lelandhuang |
last post by:
I am developing reporting service and using lots of 'LEFT OUTER JOIN',
I am worried about the performance and want to use some subquery to
improve
the performance.
Could I do that like below,
...
|
by: Swami |
last post by:
I have 2 questions relating to website design in asp .net:
1. In a website that I am building I have everything as a user control. Even
the header, which contains the navigation tabs is in a user...
|
by: dilippanda |
last post by:
Hi,
Can you please explain me how indexes improve performance?
And where to use which index?
A link will also be useful for me.
Thanks,
Dilip
|
by: Vyas111111 |
last post by:
Hello all
I have a windows form,in this page I am creating lots of controls at runtime.So when my form is load it takes time to load all controls.How can i improve performance of that page.I have...
|
by: =?Utf-8?B?Q2hyaXN0aWFuIEhhdmVs?= |
last post by:
Hi,
I am looking for a source (e.g. book) how to improve the performance of C#
applications.
Christian
|
by: Gilles Ganault |
last post by:
Hello
I'm no PHP expert, and I'm reading "Building scalable web sites". In
the tips section, the author mentions using templates to speed things
up. I was wondering how the template engines...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |