abbaye / WpfHexEditorControl

Wpf Hexeditor is a powerful and fully customisable user control for editing file or stream as hexadecimal, decimal and binary. Can be used in Wpf or WinForm application
https://www.nuget.org/packages/WPFHexaEditor/
Apache License 2.0
815 stars 136 forks source link

WpfHexaEditor.HexEditor causing Visual Studio, Application to lock up, spawning hundreds of threads #32

Closed Mgamerz closed 5 years ago

Mgamerz commented 6 years ago

Expected Behavior

While in designer view, Visual Studio should not lock up when WPFHexaEditor is visible. Having two blank HexEditor's should not seriously degrade application performance.

Actual Behavior

I'm finding when a second HexEditor (the stable version) is shown on screen, performance of Visual Studio becomes very sluggish. While in app (and running), when I show a second HexEditor is loaded the performance of the application degrades significantly in both Visual Studio and app:

Steps to Reproduce the Problem

I am not 100% sure how reproducible this is in another setup. My setup is as follows.

  1. Put a hexeditor in a tabcontrol tab
  2. Put another hexaeditiro in another tab in the same tabcontrol
  3. When the second tab's tab control is visible, visual studio (and the running application) performance degrades to the point of near unusability.

I have had this issue for some time now, however it was killing visual studio performance signifcantly across the board. I have reported it as an issue with Visual Studio. They finally fixed some unresolved reference bugs in 15.7.3, however some Visual Studio developers looked at my project and took note of how many threads were being spawned by WPFHexaEditor.dll!WpfHexaEditor.Core.Caret.BlinkCaret. I have a thread on DeveloperCommunity for Visual Studio where they talk about it. https://developercommunity.visualstudio.com/comments/264723/view.html

As it stands I can't use this project as it is killing my application performance as well as the development environment when I'm in designer view. It's a good project, if this issue can be resolved I would love to continue using it.

abbaye commented 6 years ago

I Will check this soon as possible Thank you

romni commented 6 years ago

hi @abbaye, im looking to use this control in an application im developing but this issue makes the control unusable. any update?

abbaye commented 6 years ago

Hello @romnous sorry i Will check this issue the next weekend when i will go to home after camping :)

abbaye commented 6 years ago

Are tout use the code version or binary from nuget ?

romni commented 6 years ago

i'm currently working with the version from nuget. later in the week i'll have time to try this out with the latest version on the master branch and i'll report back to you

abbaye commented 6 years ago

Ok the version on nuget have some issue. Please compile code from master Branch

romni commented 6 years ago

latest master is giving me the same issues. i'm also noticing i can't set focus to text fields or other editable controls on the same tab while the HexEditor is present

abbaye commented 6 years ago

Ok i need to check this. I dont know why at this moment

abbaye commented 6 years ago

I have checked but i can't reproduce bug.

MrCzz commented 5 years ago

Hello Abbaye,

I created a small project which shown the issue with the WpfHexEditorControl. See attachment

It is a simple example project, which will be very slow when you try to change the:

<TextBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Center" Text="HEXEDITOR" Height="100" IsEnabled="False" />

with:

<wpfHexaEditor:HexEditor Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2"  Width="Auto" Height="100" VerticalAlignment="Center" />

Compiled the latest master .NET Framework 4.5.1, compiling on .NET Framework 4.6.1. Hopes this helps you.

Re-Upload: HexEditorCrashTest.zip

abbaye commented 5 years ago

Thank you mrczz I will test this tomorrow.

abbaye commented 5 years ago

Hello MrCzz

Did you have tested with the lastest code or you use an old version on nuget ?

MrCzz commented 5 years ago

Compiled with latest master in github version .NET 4.5.1.

The nuget package only support .NET 4.7.1. I compile the code on .NET 4.6.1.

abbaye commented 5 years ago

Ok I never tested control with tabcontrol. I think I have a bug with.

I need to check this closer :)

MrCzz commented 5 years ago

Do you have a status update on this?

abbaye commented 5 years ago

Not For now :( I have not time to check until I finished.my University session in April. Sorry for this. I make this project in my free time and is rare now :(

abbaye commented 5 years ago

I have juste pushed a update of sample with tabcontrol support. I will add posibility to open new file in new tab control for make a better test

abbaye commented 5 years ago

I Think the bug is fixed.

please check on your side and give me an update on this

MrCzz commented 5 years ago

Thank you, will test it.

romni commented 5 years ago

bug appears to be fixed here (running latest nuget release (v1.6.2) on .NET 4.6.1 using both VS2017 and Rider 2018.3.3)

abbaye commented 5 years ago

GOOD! :) Have a great day everybody