diffplex icon indicating copy to clipboard operation
diffplex copied to clipboard

Massive performance improvement with large [25k+] documents in WPF.

Open ben-abraham opened this issue 2 years ago • 5 comments

Can now easily handle 25k+ line files in side-by-side mode.

  • Fully convert InternalLinesViewer to using virtualized component rendering
  • Added a basic ViewModel for InternalLinesViewer (LineViewerLineData). Supports dynamic visibility changes.

You can increase the repetitions in MainWindow.xaml.cs to 1000 to get a 25k line document, which is handled on my system easily.

Let me know if there are any improvements you can offer. The style mechanism could be improved to be more pure-wpf, and I think the font properties might already inherit by default (although I'm not 100% sure about this one, I need to test it)

ben-abraham avatar Jul 05 '22 04:07 ben-abraham

Note: a big missing feature with this now, is that you can't highlight/select the text at all since they are now TextBlock objects.

There are a few solutions that could fix it I think, but they would be fairly involved.

ben-abraham avatar Jul 07 '22 04:07 ben-abraham

@ben-abraham Thanks for contributing. It's an interesting change although making text not selectable is a bummer.

@kingcean can you take a look and share any thoughts?

mmanela avatar Jul 13 '22 12:07 mmanela

Looks good!

kingcean avatar Jul 13 '22 14:07 kingcean

Sorry for the lack of update, I'm trying to implement this with Document/Span elements directly without virtualization, which seems performant enough by itself, and should allow selection to work as well. Just having trouble getting the look to match quite right, so I kind of have to rework the WPF styles to make it work correctly. Also a few bugs related to scroll bars that need to be sorted out.

ben-abraham avatar Jul 30 '22 15:07 ben-abraham