Jump to content

Strange DBGrid loading time


zhyhero

Recommended Posts

My application were use some free  datamodules as public data and method store.

And these modules are belong to MainModule as a public member.

For example ,the PublicLogin used to do login things,like check username and password,record current login user info.

So,   LoginForm->MainForm->SomeBusinessFrame  is the workingflow.

But,  loading time of the BusinessFrame's DBGrid had some problem.

Use LoginForm or not ,it had diffrent DBGrid loading time.

Here is CodeSiteLogging 's Log.

LoadingTime.thumb.png.a4e3ea8e2e3266a94c1b4ececbe5eefd.png

The left logs  use a LoginForm (unit) , call "PublicLogin.Login()" and "ModalResult:=mrOk"  to  MainForm.   DBGrid's Loading Time are 5xxx ms.

The right logs  remove LoginForm (unit) and call "PublicLogin.Login()" method in MainForm.FormShow event.  DBGrid's Loading Time are 5xx ms.

This is so strange .

Please give some advice to me.

  

Link to comment
Share on other sites

39 minutes ago, zhyhero said:

Update .

In my case ,  set "UniServerModule.AsyncRequest:=false"  ,  DBGrid's loading time decreased to 3xx ms.

And  it has nothing to do with LoginForm. 

 

This will disable ScreenMask and may be slow down all working proccess !

Link to comment
Share on other sites

Hard to give a definite answer based on the above. But seems that you are loading the frame in the mainform on show. This could impact performance as the form then is already done and visible. I'd recommend to instead do the frame loading in the Mainform create. Depending on how many controls you have in the frame this could impact a lot. (But can of course also be something else as well) 

Link to comment
Share on other sites

Update.

After a lot of testing, I found   property "Column.Flex"   looks  like  the key point.

In my case ,when set  Column.Flex:=1 ,dbgrid loading time extended to 5xxx ms , when leave Column.Flex:=0 ,it is 5xx ms.

 

btw: In my case. there are 9 dbgrids and 10+ datasources and datasets.

9 grids have 50+ columns. 10+ datasets have 70+ fields.   

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...