epasveer / seer

Seer - a gui frontend to gdb
GNU General Public License v3.0
2.13k stars 69 forks source link

Option to limit depth on new struct visualizer #92

Closed pcrain closed 2 years ago

pcrain commented 2 years ago

The new struct visualizer slows down to a crawl when visualizing structs / classes more than 4 levels deep or so, and I am unfortunately unable to use the struct visualizer since upgrading to 1.10. 😕 I can still use 1.9 for now, but in the next release it would be nice to have an option to limit the maximum depth the struct visualizer will look for nested structs. Thanks! 🙂

epasveer commented 2 years ago

Hi,

First, thanks for trying Seer. Second, you a Red Wings fan?

It's not advertised, but in v1.10, you can still get at the old struct visualizer with ALT+V. It will bring up a blank visualizer that you can type in the variable expression.

I have some ideas to make the new one quicker. A couple things I can do:

I have a program that might exhibit the same problem you see. However, if possible, can you include a screenshot of the your visualizer? It might give me a better picture of reproducing the problem.

pcrain commented 2 years ago

Thanks for the response! I am not personally into sports much but a very good chunk of my family is into hockey and are definitely Red Wings fans. 😅

I am unfortunately not able to include a screenshot as I am working with a proprietary code base, but I shall try the Alt+V method you suggested. 😄 All of your suggestions for making the new visualizer quicker sound good as well, I shall look forward to them. I really love how Seer is coming together so far! 🙂

epasveer commented 2 years ago

No problem on the screenshot. I think I have a program to test with. I'll let you know of my progress.

epasveer commented 2 years ago

Hi,

Internally, I can add a cache mechanism. There are certain updates that will do a slow lookup in the variable tree. I think this can be improved.

I've sped this part up. If you're feeling brave, you can clone/pull the "main" branch of my repo and build Seer to see if it's still slow for your application.

Depending on what you find, I'll see if the 'expand 1 level' button is needed.

pcrain commented 2 years ago

It's definitely considerably faster! 😃 It now loads about 7-9 levels deep instead of 4-5 levels, but still ultimately grinds to a halt and hangs the entire program if I take too long to close the visualizer window. 😕

An expand 1 level button could be nice, but another idea would be to just have the individual arrows on the lefthand side of each variable in the struct tree expand one level at a time. As it stands, those arrows (at least for me) recursively expand all variables below them, which seems redundant with the purpose of the "expand all" button in the top right of the visualizer.

epasveer commented 2 years ago

purpose of the "expand all" button in the top right of the visualizer.

Currently, if nothing is selected, the "expand all" button expands the entire tree recursively. If something is selected, "expand all" expands everything recursively from that selected point.

I can change the action of the "arrow" to expand just one level - not everything below it recursively.

A note about the automatic recursive action. It does stop if the variable is a pointer. If it is a pointer, then the "arrow" needs to be clicked to expand it.

about 7-9 levels deep

That's quite the structure tree. I'm curious what your app might be? :^)

but another idea would be to just have the individual arrows on the lefthand side of each variable in the struct tree expand one level at a time.

I'll implement this. It's a good idea, I think. I'll also make it so it expands the first level by default.

epasveer commented 2 years ago

Hi, Maybe a compromise.

I've added a "Recursive" box.

If on, any Expand that happens (via the "arrow" or the "+") will recursively start expanding from the selected point. While it is expanding, you can stop it in its tracks by unchecking the "Recursive" box.

If off, it expands just 1 level. The default is off.

You can clone/pull the "main" branch to try it out.

image

pcrain commented 2 years ago

Sorry for the delay, I just got a chance to test things at the end of Friday and haven't had time to respond until now. The new single expansion option for the visualizer works beautifully. 😃 I don't know if I'm at liberty to say exactly what I'm working on, but now that things aren't slowing to a crawl, I am noticing that a large part of the problems I was having concerned iterating through linked lists of complex class instances. So visualizing 9-levels deep was really just looking at the next node in a linked list 8 times. 😅 In any case, this new change certainly helps with avoiding slowdown from complex nested classes, linked lists, cyclical data structures, and recursive structures all very cleanly. I'll mark this as closed for now, thanks for all of your help! 😄

epasveer commented 2 years ago

Great! Thanks for trying Seer and thanks for the feedback.