Skip to content

Large JSON ​

This demo loads an array of 5,000 objects. jsoneditor handles large documents well when a few precautions are followed.

Large JSON (5,000 items)

Performance tips ​

  • Start in code mode. The Ace-based code editor virtualizes rendering; tree mode creates DOM nodes for every visible entry and is slower to open for big documents. Users can still switch to tree.
  • Use shallowRef instead of ref. A deep ref makes Vue wrap every nested object in a reactive proxy, which costs memory and time on every update. With shallowRef only .value is tracked; replace the whole value to update.
  • Debounce updates with :debounce="200" (150 to 300 ms works well) so v-model is not re-parsed on every keystroke.
  • Avoid deep watchers on the bound value; listen to @change instead.
  • Disable features you do not need in options, for example { enableSort: false, enableTransform: false, search: false }.
  • Reserve the height with the height prop 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.

Released under the MIT License.