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

Limit "preview" of clicked array in treeview #25

Open
BloodyRain2k opened this issue Dec 1, 2023 · 0 comments
Open

Limit "preview" of clicked array in treeview #25

BloodyRain2k opened this issue Dec 1, 2023 · 0 comments

Comments

@BloodyRain2k
Copy link

Describe the bug
I needed this tool to inspect a JSON log dump that's almost 200 mb.
And in doing so I found out that care should be taken when clicking arrays in the treeview.

Because one of these was on the 2nd level of the file and I accidentally clicked on it which froze the app up.
Likely because it started generating the "Array data" for all 5k entries in that array and their entire structure...

To Reproduce
Open a JSON file with an array close to the root that contains a lot of deep structured entries. Something like:

{
  array: [
    { complex object },
    ... // couple hundred or more like the above
  ]
}

Expected behavior
I would've expected the app to "keep an eye" on how much data for the "preview" it already generated and eventually realize, that if the first item already generated over 5 kb of text, then it might not be a good idea to fully iterate further.
And instead all remaining entries should be iterated very shallowly, if at all.

Maybe it would be a good approach to only iterate the first item in the array for 1 level, so the keys could be shown with their data/datatype, then iterate all remaining items the same way and then check how much text that generated.
If it's already several dozen kb at that point, then iterating deeper wouldn't be very beneficial.

This app is meant for large data structure after all, so it shouldn't lock or eventually kill itself by generating hundreds of kb of text for a textbox.

Desktop (please complete the following information):

  • OS: Windows 10 x64 19045.3693
  • Version of HugeJsonViewer: 0.4.12.19 portable

Additional context
I'll see if I can throw together a script that generates a JSON file that remotely shows the issue.

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

1 participant