Recent

Author Topic: I need to output on screen nealry 25 000 000 lines after calculations  (Read 4473 times)

teochris

  • Jr. Member
  • **
  • Posts: 86
Hello, I need during my program execution to output almost 25 millions of lines results of some calculations, like below lines

1,2,3,4,5-1
1,2,3,4,6-1
1,2,3,4,7-1
1,2,3,4,8-1
1,2,3,4,9-1
1,2,3,4,10-1
...
1,2,3,5,1-1
1,2,3,5,2-1
1,2,3,5,3-1
...
41,42,43,44,45-20

Which component can do such an operation?

A scrollbar for this component will be needed for the user to be able to see all results and I also need the user if he likes to be able to export these results to a txt or csv file or maybe to a printer if the results are only a few.

What would be the faster way to output these results - first do the calculations and then output them or output them after each calculation?

Any ideas?
« Last Edit: May 16, 2016, 04:36:08 pm by teochris »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
I'd recommend TMemo. If it's incapable of handling 25M lines (which is possible for Windows widgetset) then TRichMemo

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
SynEdit can do that. tested (and not tested: likely much faster than TMemo)
make sure to use BeginUpdate, and set Capacity upfront, then use Append() for each line. Also disable all features you do not need (such as trim spaces).

Not tested, but VirtualTreeView should handle that too. (Afaik its designed for large data)

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Also if it's not important that you see the values on screen, it would be faster to directly write them to file.

balazsszekely

  • Guest
TVirtualStringTree is what you need. 25 million records added in 2.2 sec(see attachment)
« Last Edit: May 16, 2016, 07:28:45 pm by GetMem »

teochris

  • Jr. Member
  • **
  • Posts: 86
TVirtualStringTree is what you need. 25 million records added in 2.2 sec(see attachment)

It seems a fery fast time - Can you please tell me if I would be able to also export data to a file after output on virtualstringtree?

balazsszekely

  • Guest
Quote
@teochris
Can you please tell me if I would be able to also export data to a file after output on virtualstringtree?
Yes you can! You just need to loop through the nodes.

dogriz

  • Full Member
  • ***
  • Posts: 126
Reading 25 million lines from screen after each calculation seems like a very bad idea. You should think about some automation – additional data (calculation result) analysis, instead of manually looking at so much data.  %)
FPC 3.2.2
Lazarus 2.2.4
Debian x86_64, arm

 

TinyPortal © 2005-2018