Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Highlight Speed #103

Open
vector-man opened this issue Jun 13, 2021 · 10 comments
Open

Improve Highlight Speed #103

vector-man opened this issue Jun 13, 2021 · 10 comments

Comments

@vector-man
Copy link

vector-man commented Jun 13, 2021

Expected Behavior

I have a loop adding highlights to a file with AddHighLight(...). It should not take very long.

Actual Behavior

Highlight loop takes quite awhile to add big highlights

Steps to Reproduce the Problem

  1. Use hexView.AddHighLight(918010, 65535, false)
@abbaye
Copy link
Owner

abbaye commented Jun 14, 2021

Use CustomBackGround Block for this ... is more suited for this task.

cbb = new CustomBackgroundBlock(918010, 65535, Brushes.Yellow);
hexedit.CustomBackgroundBlockItems.Add(cbb);
hexedit.RefreshView();

@vector-man
Copy link
Author

vector-man commented Jun 29, 2021

It's still quite slow when working with lots of highlights in files. Lots of slowdown too when scrolling highlighted data.

@abbaye
Copy link
Owner

abbaye commented Jun 29, 2021

Are you using CBB ? Or highlight ?

@abbaye
Copy link
Owner

abbaye commented Jun 29, 2021

Are you tested the ByteFileDiference sample ?

@vector-man
Copy link
Author

vector-man commented Jun 30, 2021

I haven't tried that sample yet. I just used your solution above, but put it in a loop that adds several highlights (maybe in the thousands), and it's very slow on my PC. It hangs at hexedit.RefreshView() for quite awhile after I add them all. I'm using it in Windows Forms by the way, so I'm not sure if that's part of the issue.

@abbaye
Copy link
Owner

abbaye commented Jun 30, 2021

I don't think winform turn down the speed...

but it's possible to see you code ? It's in a public repo ?

@vector-man
Copy link
Author

I can show you the code. I'll try to upload it to a branch soon.

@abbaye
Copy link
Owner

abbaye commented Jul 1, 2021

Good I will check your code... If I can optimize I will do...

I you want you can try to optimize and send a pull request 😄

@sbruyere
Copy link

sbruyere commented Mar 6, 2023

I confirm it's very slow also with very large CustomBackground (> 500 lines) like in this capture.
image

@abbaye
Copy link
Owner

abbaye commented Mar 6, 2023

I need check for optimise my code. I forgotten this bug in last week 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants