StrataFrame Forum

Infragistics Grid Loading

http://forum.strataframe.net/Topic17575.aspx

By David Daragon - 7/2/2008

Hello,

I'm a strataframe beginner. I want to load several records on a infragistics grid to make tests.

I use a business binding source.

I want to load 20 000 records. The time to load is very long (around 4-5 min) Is it normal ?

Thanks for your help

David

By Bill Cunnien - 7/3/2008

Hi David,

Welcome aboard!

20k records is quite heavy lifting for a any grid to handle.  A user is not likely going to need all those records in order to interact with them.  Is there any way to bring a functional subset to the grid?  Try to keep the record count to around 200.  That seems like a decent number for a grid and a user to handle.

Don't forget, you can add a browse dialog so that user can pick his own records according to his own criteria.

Take care, and enjoy the framework!
Bill

By David Daragon - 7/3/2008

Thanks for your help Bill.

I know that a user doesn't have to use 20 000 records on a grid.

But I just made tests between different frameworks to know their performances.

When I try an other, the records are loaded very quickly compare to StrataFrame 

David

By Aaron Young - 7/3/2008

Hi David,

I have just tested an Infragistics grid with 15000 records which runs off an SF BBS. Inside Visual Studio 2008 on a Release build it takes around 3 minutes 20 seconds to open the form when run with debugging. When run without debugging (or when you run the application outside of VS) the time reduces to 7 seconds.

This is not unexpected as VS does place a significant overhead when running an application in debug mode.

Bottom line is you can do it and the above form hasn't been optimized yet.

Regards,

Aaron

By Trent L. Taylor - 7/3/2008

I want to load 20 000 records. The time to load is very long (around 4-5 min) Is it normal ?

You have something setup terribly wrong, then David.  As a test the other day, I had a grid load over 40000 records in less than 5 seconds....so you clearly have something setup wrong here.

How are you even trying to populate and bind to the grid?  Do you have custom properties calling scalar methods in the mix, etc?  Are you using a BusinessBindingSource?  Because if you have this setup right, it will be WAY faster than what you are describing.  In fact, I have never heard of one coming back this slow before (StrataFrame or otherwise).  The other day I was consulting an SF user and they had a form taht was loading 80,000 records.  Aside from the point that they didn't need to bring this many records back, and their query needed to be optimized, it still came back and loaded the grid in around 20-30 seconds in this case.  So I am uncertain of what you may be doing here to produce such poor results.  You are welcome to post your sample, but there is clearly something not right in the mix here.

By Trent L. Taylor - 7/3/2008

Aaron also has a good point.
By Michel Levy - 7/3/2008

Bonjour David !

un test sur mon portable (Celeron 2Go RAM, SQL Server sur la même machine) me ramène 675000 lignes d'une table dans un grid en 15 secondes.

By David Daragon - 7/3/2008

Hi Trent,

I'm using a BusinessBindingSource

I just load my records by clicking on a button

_

private void btnLoad_Click(object sender, EventArgs e)

{

_chrono.Demarrer();

clientBO1.RetournerTousClients();

chrono.Arreter();

MessageBox.Show(_chrono.Valeur.ToString());

}

and my methods RetournerTousClients() is :

public void RetournerTousClients()

{

this.FillDataTable("SELECT * FROM Client");

}

What do I wrong ? Sad

Thanks for your answers and your help

David

By Aaron Young - 7/3/2008

David, are you sure you are not running your application with the F5 build in Visual Studio (which runs with the debugger)? The times you are reporting are precisely what you would get if you are. Instead of using the F5 build try using Ctrl+F5 which will run your application without the debugger.

Other than the above, the only difference with my form is the business object is filled in the ParentFormLoading event.

I would really like to know how you are running your application. Are you running it inside Visual Studio and, if so, how are you running it?

Aaron

By Trent L. Taylor - 7/3/2008

Before we dig into any details, I would like to know the answer to Aaron's question as well.  Hvae you tried to just run the EXE from a command line or through Windows Explorer versus through the VS debug environment?
By David Daragon - 7/3/2008

I'm running my application with F5 bulid in VS

I try with ctrl + F5 and I load my 20 000 records in 20 seconds

David

By Trent L. Taylor - 7/3/2008

You could probably still improve on the performance...but there is a vast difference between 20 seconds and 4-5 minutes.
By Aaron Young - 7/3/2008

Yes, 20 seconds is better and you should be able to get faster. The debugger is causing the delay. Are you happy with 20 seconds?
By David Daragon - 7/3/2008

Sure it's better but it seems a little bit to long for my boss
I'll search to improve my code.
By Aaron Young - 7/4/2008

I would check how long it takes to simply execute the SQL query inside SQL Server Management Studio. If the query isn't optimized or if the SQL Server engine itself is slow there is little you will do in code. There are many factors outside of your code that can affect the performance as you can see from the significant performance drop when using the debugger.

But 20 seconds is better than 4 minutes.

By Trent L. Taylor - 7/4/2008

Aaron is right on the money here.  You first need to see where your bottleneck is.  The very first thing that you would need to do is open up SQL Server Management STudio and turn on the profile timings (SET STATISTICS TIME ON) and see how long it takes to execute the query and return the result set.  Then go from there.
By David Daragon - 7/9/2008

Hello,

I made tests yesterday with Michel. We found the cause of the slow loading of my records.

We made tests with a win grid classic instead of a Infragistics grid and the time of loading is 270 ms for 20 000 records ! It's quite better Smile I'm impressed !

I did tests with a database with 433 000 records this morning and the result is 7.2 sec.

So, according to Michel and I, the problem comes from the Infragistics grid. I downloaded a trial version (NetAdvantage for .NET 2008 Vol. 2 : Bundle [.NET 3.0]) Could it be possible that the slow loading is due to the version ?

David

By Aaron Young - 7/9/2008

Could it be possible that the slow loading is due to the version ?

I have used Infragistics grids for many years and I don't recall noticing any performance changes between versions. There is no doubt that an Infragistics grid has much more power and features over the built-in Windows grid and this should translate to slower initialization. However, I have never tried the simple windows grid as I need the Infragistics features and don't have speed issues.

I would suggest you check which features you have turned on in the Infragistics grid - try turning off as many advanced features that you can to bring it down to the same level as the windows grid.

Also, take a look at the Infragistics grid code in the form Designer file as I have seen the UltraGrid Designer put unnecessary code in here if a lot of changes have been made. I remember being able to remove about 100 lines of initialization code that the designer had inserted which effectively cancelled each other out - the code was simply unnecessary.

Now that you know the SF BBS is not the cause and that the windows grid is faster, I would recommend posting a message on the Infragistics technical forum as well. They may be able to give you an insight into why the two grids perform differently.

Aaron

By Trent L. Taylor - 7/10/2008

I am on-board with what Aaron is say as we too use the Infragistics grid in our medical software...though sparingly.  There are in the neighborhood of 3000 properties (or more) on the Infragistics grid...which is insane and frustrating.  In fact, we found a property the other day that sped up performance on something that we were doing...if I could recall what it was I would tell you, but I don't think this particular property would affect what you are trying to do.

This is one reason that we are very careful on using too many 3rd party tools and we, like you, spend a good amount of time testing performance and optimization, which definitely pays off in the long run.

I am sorry that I cannot be more help with the Infragistics grid...if you get a chance, you may throw a post out on their forum and see if they have any ideas.

By David Daragon - 7/22/2008

Hi Aaron

Is the difference due of the fact that I have a trial version of Infragistics ?

Thanks

David

By Trent L. Taylor - 7/22/2008

The trial should make no difference as you have the full functionality of the software.  Just the license is time limited and you do not get the source code.  So that should not be a factor.
By Aaron Young - 7/22/2008

Is the difference due of the fact that I have a trial version of Infragistics ?

Hi David,

I agree with Trent - the trial version is the same codebase and you can simply activate your demo version without having to reinstall it.

I would recommend that you turn off any advanced grid features to see if that helps. If it does it is then a case of tracing the culprit. Infragistics have a number of built-in presets that you can access from the Ultragrid designer and you can drastically change the grid's behaviour with a couple of mouse clicks.

Some features will have an impact on performance with large recordsets. For example, if you have row summaries turned on I would try turning them off first. Also, are you using the grid to set the sort order or are you taking the natural order supplied by the BO? Have you added any formating code in your source code that effects the grid?

Unfortunately, there are so many possibilities it is difficult to comment without knowing more. Could you send or post a screenshot of your grid with some data loaded?

Regards,

Aaron

By David Daragon - 7/22/2008

Hi,

I think I find the issue of my problem.

It would be indeed an obviousness for you and that's why you didn't talk about it.

In fact, I didn't set the LoadStyle property to LoadOnDemand.

With this line of code, my grid loads in 610 ms. It's great ! Smile

this.grdClient.DisplayLayout.LoadStyle = Infragistics.Win.UltraWinGrid.LoadStyle.LoadOnDemand;

David

By Aaron Young - 7/22/2008

Hi David,

Personally I don't use LoadOnDemand as I have grid sorts/filters already setup and I frequently use row summaries which means all rows have to be loaded. When that is the case the grid will override LoadOnDemand and will enforce the pre-loading of all rows - so you will need to be careful as your grid will switch back to preloading all rows if you enable any grid feature that requires all rows to be loaded.

If you notice a drop in grid performance in the future then it is likely a feature has been enabled that requires all rows and the grid will ignore your LoadOnDemand setting.

Aaron

By David Daragon - 7/22/2008

Ok Aaron, thanks for these info.

I think many of my grids will have to need to be sorted or have summary.

I was happy of my discovery this morning but I will go on my searchs.

By Trent L. Taylor - 7/23/2008

Glad you got it going. Smile  Thanks for your input, Aaron!
By David Daragon - 7/30/2008

Hi,

I send you a screen copy of my grid. For me, it's a normal grid. I set no extra options, only the basic.

David

By David Daragon - 8/3/2008

I posted a message on a Infragistics' forum.

I had a response and they said that to me :

"Additionally, Infragistics has not tested the use of NetAdvantage for .NET with the StrataFrame framework.  We are unfamiliar with what it is or what it is supposed to do.  We may not be able to provide support for the use of NetAdvantage for .NET controls with this framework, unless the same problem can be duplicated without this third-party tool."

So what can I do now ?

David

By Trent L. Taylor - 8/4/2008

David,

They know who we are and that is just a post from someone who doesn't feel like dealing with your problem.  We actually have a relationship with them...so that is some low-level person posting on the thread....but let's back up.  I don't understand why you are having any issues here as the Infragistics grid is a highly used grid...including by us within our medical software.  Based on your last post and your screen shot...I did not know that you still had a problem...so what is your problem?

By David Daragon - 8/4/2008

Hi Trent,

My problem is that when I load 20 000 records on a windows datagrid, it takes 600 milliseconds
And when I do the same with the infragistics grid, the loading are slow, it takes about between 6 and 7 seconds.
I wonder why there is a such difference.

Regards,

David

By Aaron Young - 8/4/2008

Hi David,

I am afraid you gave Infragistics the excuse to ignore your problem by simply mentioning Strataframe. Their support is not as helpful as here and you are not even guaranteed a response. But mentioning SF has simply given them an opt-out which they have taken.

Why don't you create a separate test form and create a dataset that duplicates what you are trying to do with the SF BO? This way you would simply be binding the grid directly to a pure .NET dataset and Strataframe would be removed from the equation. If you still get 6 or 7 seconds to load the grid then at least you know your problem is in the grid configuration itself.

Aaron

By David Daragon - 8/4/2008

Thanks Aaron

I will try this and I'll tell you what will happen.

By David Daragon - 8/13/2008

Finally we decided to not use Infragistics components so this post can be closed.

We decided to use StrataFrame components because they are very pleasant to use.