-
Notifications
You must be signed in to change notification settings - Fork 131
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
Slow performance when loading large JSONs and toggling collapse/expand #138
Comments
Have you turned on the virtual list mode? |
Yes, sorry, I've configured it as follows: <vue-json-pretty :data="filteredData"
ref="results"
style="height: inherit; max-height: inherit;"
:deep="expandDepth"
:deep-collapse-children="true"
:show-double-quotes="false"
:virtual="true"
:virtual-lines="100"
:select-on-click-node="false"
:highlight-selected-node="false"/> |
I'm also seeing something similar, some JSON loads are taking over 10 seconds and are blocking the rest of the UI from loading. I've not looked into this but what are your thoughts on @gurupras investigation about One option in my mind is if If we could find a way to increase efficiency that would be ideal. |
Sorry, I have been busy recently and did not reply in time. I found this problem. In the demo, when the array reaches 10,000, it took 5s to calculate. My thought is whether it is possible to use the ability on the worker to calculate it? There is also a feature here, which is the number of rows of current data, so we have to ensure that we can calculate the number of each row of data. |
the same to me |
In the latest version(1.9.0 & 2.2.0), the efficiency of JSON parsing has been improved by 40 times compared with the previous version, maybe you can have a try. |
I think the entire JSON tree is being re-rendered every time one item is toggled. This does not scale well for large JSONs.
Additionally, the component struggles to display a JSON of size ~21MB 🙁
One thing I did notice was that most of the time is being spent in
jsonFlatten
and/orflatData
computation. Is there anything we can do to improve both of these? Given thatjsonFlatten
is not touching the DOM in any way, can we parallelize the work using WebWorkers? I'm happy to work on implementing it, but I don't fully understand the codebase yet.Branch: 1.x
json-load-performance.mp4
json-toggle-performance.mp4
The text was updated successfully, but these errors were encountered: