Comments (5)
Is the delay from the core lib or the UI control?
from diffplex.
I have the same issue (using DiffPlex.Wpf v1.3.1 in my NET5 winforms application).
The files that I tested were 40k lines of JSON.
The loading appears to happen during form.ShowDialog(), and when I try SideBySideDiffBuilder.Diff() it completes pretty much instantly, so it seems to me that the delay is in the UI control. (it also slowly consumes more and more RAM, up to around 2GB before I run out and have to kill the process in task manager)
Looks like the same issue as here: #87
from diffplex.
i try, WebDiffer is fast, DiffPlex.Wpf is slow , InsertLinesAsync method is slowly , InternalLinesViewer ->StackPanel add
VirtualizingStackPanel.VirtualizationMode="Recycling" VirtualizingStackPanel.IsVirtualizing="True"
will not slow when drag,but load file still slow
from diffplex.
i solute the question , changed InsertLinesAsync method
private static async Task InsertLinesAsync(Guid guid, InternalLinesViewer panel, List<DiffPiece> lines, bool isOld, UIElement source, int contextLineCount) { // For performance. if (lines == null || panel == null) return; var disablePieces = lines.Count > MaxCount; var i = 100; if (panel.TrackingId != guid) return; InsertLinesInteral(panel, lines.Take(i).ToList(), isOld, source, disablePieces); while (i < lines.Count) { //await Task.Delay(i > 5000 ? 1000 : 800); if (panel.TrackingId != guid) return; await panel.Dispatcher.BeginInvoke(() => { InsertLinesInteral(panel, lines.Skip(i).Take(100).ToList(), isOld, source, disablePieces); }, DispatcherPriority.Background); i += 100; } if (contextLineCount > -1) CollapseUnchangedSections(panel, contextLineCount); }
2 points:
500-> 100
Invoke ->BeginInvoke ,thread level is DispatcherPriority.Background
from diffplex.
private static async Task InsertLinesAsync(Guid guid, InternalLinesViewer panel, List<DiffPiece> lines, bool isOld, UIElement source, int contextLineCount)
{ // For performance.
if (lines == null || panel == null) return;
var disablePieces = lines.Count > MaxCount;
var i = 100;
if (panel.TrackingId != guid) return;
InsertLinesInteral(panel, lines.Take(i).ToList(), isOld, source, disablePieces);
while (i < lines.Count)
{
//await Task.Delay(i > 5000 ? 1000 : 800);
if (panel.TrackingId != guid) return;
await panel.Dispatcher.BeginInvoke(() =>
{
InsertLinesInteral(panel, lines.Skip(i).Take(100).ToList(), isOld, source, disablePieces);
}, DispatcherPriority.Background);
i += 100;
}
if (contextLineCount > -1) CollapseUnchangedSections(panel, contextLineCount);
}
from diffplex.
Related Issues (20)
- .NET 5 support HOT 2
- Add option to ignore trailing commas HOT 1
- Stream support HOT 1
- Can you copy the left and right rows and get the changed content at the same time? HOT 2
- Next / Previous commands for WPF controls? HOT 9
- ChangeType.Modified is not working, instead it shows the changed line as deleted and added HOT 1
- Unexpected line diffs when a code block is inserted after a previous difference
- Customise skipping of lines HOT 2
- spurious blank lines at end HOT 1
- Any chance of having a search feature in the future?
- Wrap lines in WPF control? HOT 4
- Could Diffplex avoid exporting the Log class? HOT 1
- 3 way diff?
- using diffplex with StructureMap
- WPF DiffViewer Splitter bar issue HOT 5
- When two strings end with the same words, CreateWordDiffs includes the first common word as an insertion and deletion HOT 3
- Is UnidiffFormatter.cs no longer included? HOT 1
- Cannot diff spaces HOT 3
- No text showing in windows forms HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diffplex.