Large JSON
This demo loads an array of 5,000 objects. jsoneditor handles large documents well when a few precautions are followed.
Performance tips
- Start in
codemode. The Ace-based code editor virtualizes rendering;treemode creates DOM nodes for every visible entry and is slower to open for big documents. Users can still switch totree. - Use
shallowRefinstead ofref. A deeprefmakes Vue wrap every nested object in a reactive proxy, which costs memory and time on every update. WithshallowRefonly.valueis tracked; replace the whole value to update. - Debounce updates with
:debounce="200"(150 to 300 ms works well) sov-modelis not re-parsed on every keystroke. - Avoid deep watchers on the bound value; listen to
@changeinstead. - Disable features you do not need in
options, for example{ enableSort: false, enableTransform: false, search: false }. - Reserve the height with the
heightprop so the page does not jump while the editor loads.
WARNING
In tree mode jsoneditor shows large arrays in pages ("show more"), but auto-expansion on update still has a cost. If you need tree mode for very large data, call collapseAll() through a template ref after loading.