Jump to content


Photo

Speed NextGrid Save and Load


  • Please log in to reply
12 replies to this topic

#1 Dirk S.

Dirk S.
  • Members
  • 15 posts

Posted 15 January 2010 - 07:21 PM

One of the demos shows the speed of adding 100.000 lines, on my computer about 500 mSeconds (D7) and sorting is very fast.
When I save the grid with the 100.000 lines, it wil take a very long time (51.99 sec) and loadfromtext (62.77 sec) also.

I am new with NextGrid 5.0.6 and did not find something in the help file to speed up this actions with a large amount of rows. So my question is: Is there a way to speed up this operations?

For example the common Delphi listview can run in virtual mode and can handle large files and data.
Maybe something is build in NextGrid or comming for the component?

Thanks for your time, Dirk S.

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 15 January 2010 - 10:12 PM

Hello Dirk,

Try to add BeginUpdate at the start of loading and EndUpdate on the end.

This should speed up. Here is more details http://dn.bergsoft.n...ze-nextgrid.htm

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Dirk S.

Dirk S.
  • Members
  • 15 posts

Posted 16 January 2010 - 01:13 AM

The times for saving and loading are include BeginUpdate and EndUpdate.
How do I combine load and save with AddRow(integer)?
And what about the virtual mode ?
Thanks DS


#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 16 January 2010 - 11:14 PM

Hello,

You may use BeginUpdate/EndUpdate in any heavy situation.

Virtual mode is currently only supported for VirtualColumn. I will try to add virtual mode for NextGrid 6.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 Dirk S.

Dirk S.
  • Members
  • 15 posts

Posted 17 January 2010 - 05:16 PM

QUOTE (Boki (Berg) @ Jan 16 2010, 11:14 PM) <{POST_SNAPBACK}>
Virtual mode is currently only supported for VirtualColumn. I will try to add virtual mode for NextGrid 6.

Thanks for your answer. Gr DS

#6 Dirk S.

Dirk S.
  • Members
  • 15 posts

Posted 01 December 2010 - 01:06 PM

QUOTE (Boki (Berg) @ Jan 16 2010, 11:14 PM) <{POST_SNAPBACK}>
Virtual mode is currently only supported for VirtualColumn. I will try to add virtual mode for NextGrid 6. Best regards

It's almost a year ago I asked you something about fast saving and virtual mode. I hope you are experimenting with VM at this moment to add it in Nextgrid? DS

#7 Dirk S.

Dirk S.
  • Members
  • 15 posts

Posted 16 March 2014 - 07:49 PM

Virtual mode is currently only supported for VirtualColumn. I will try to add virtual mode for NextGrid 6.
Best regards

Version 6 is comming now, I hope you have inplanted virtual mode for the NextGrid?!

#8 Dirk S.

Dirk S.
  • Members
  • 15 posts

Posted 16 March 2014 - 07:50 PM

Version 6 is comming now, I hope you have inplanted virtual mode for the NextGrid?!

#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 18 March 2014 - 04:41 PM

Hi,

Every Column now include OnGetValue and OnGetText events (not only Virtual column). This is one step closer to virtual mode.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#10 Dirk S.

Dirk S.
  • Members
  • 15 posts

Posted 29 May 2017 - 12:26 AM

LS,

virtual mode is implanted I suppose, do you have an example how I can read from a big csv file into your grid?

thanks for your time.



#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 29 May 2017 - 08:34 PM

Hi,

You can use NextVirtualGrid6 and NxVirtualCellSource6 components.

NxVirtualCellSource6 is non-visual component (that can be dropped on form) which connect grid with set of events.

procedure TForm5.FormCreate(Sender: TObject);
begin
  NextVirtualGrid61.CellSource := NxVirtualCellSource61;

  { Call after any big change in order to
    repaint grid, re-calculate scrollbar }
  NextVirtualGrid61.DataChanged;
end;

function TForm5.NxVirtualCellSource61GetRowCount(Sender: TObject): Integer;
begin
// Our grid have 10000 rows
  Result := 10000;
end;
If you need to provide value, you will use following event:

procedure TForm5.NxVirtualCellSource61GetCell(Sender: TObject; ACol, ARow: Integer; Cell: INxCell);
begin
  case ACol of
    0: Cell.AsString := 'Test ' + IntToStr(ARow);
    1: Cell.AsFloat := ARow;
  end;
end;
So, you don't use AddRow, InsertRow but you attach grid to your data (that you may have already pre-loaded).
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#12 Dirk S.

Dirk S.
  • Members
  • 15 posts

Posted 25 October 2020 - 02:06 PM

LS,

About ten years ago I asked if NextGrid could run in virtual mode. In version 6 that would finally be possible. In the meantime we have reached version 6.6.0.
Can NextGrid run in virtual mode as the default Listview can? I want to show a Stringlist in memory without long waiting times on the screen.
Can I find a code example somewhere?

Groet Dirk S.



#13 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 25 October 2020 - 05:11 PM

Hello Dirk,

 

You can find mini (micro) demo inside Demos\NextVirtualGrid sub-folder. But basically you can use the code from 2 posts above to see how is like to work with virtual grid. Working with columns is 100% same, but providing data is different.

 

Hope that this helps.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users