2

Im trying to create application that can display text file of size 200 to 500Mb. I tried using Textbox, with reading file line by line and appending to the Textbox. This takes 30 to 50s for 200Mb of data. Someone gave me an idea to use list of textbox instead of single textbox. Each line correspond to 1 list element. This method seems promising and gave me better result.(took 12 to 15 sec to load 200Mb text file). but the problem is Can this method be optimized to reduce this time or any other method is there? Same file, If I open in nodepad++ It hardly takes 3 to 4 sec to load the text file. How is that possible? Thank you.

Sathish V
  • 328
  • 1
  • 14
  • This might give you a clue http://stackoverflow.com/questions/837086/c-sharp-loading-a-large-file-into-a-wpf-richtextbox also this one http://stackoverflow.com/questions/1413087/wpf-multiline-textbox-for-large-content – Kamalesh Wankhede Aug 06 '16 at 09:04
  • TextBlock is faster – paparazzo Aug 06 '16 at 09:28
  • User12572, i tried those suggestions. Loading only part of the file and if user scrolls, then load the next part. In this method, how to get the scroll bar length? Im new to wpf window app. So i dont get it on how to get control of scrolling in this method. – Sathish V Aug 06 '16 at 10:21
  • Paparazi, right know im using list of text block which gives better result. Loading 200mb file in 10 to 12 sec. But this result are no where near to the loading time of notepad++ – Sathish V Aug 06 '16 at 10:23
  • Would be interesting to know, what takes up the time. My guess it's that it's mostly UI rendering and not the actual reading of the file. `virtualization` is something you might look into. – jHilscher Aug 06 '16 at 19:57
  • Ya... But i enabled virtualization in the listbox. Still didnt got any clue. – Sathish V Aug 07 '16 at 17:50

0 Answers0