Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

Keeping Large JSON Smooth in React: Update Only What Changed

Keep large JSON-backed React views responsive by measuring the slow layer first, then reducing repeated calculations, unnecessary renders, or excessive DOM nodes.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To keep a large JSON-backed React view smooth, first find whether the delay comes from data loading, repeated calculations, component renders, or a large DOM. Then optimize that layer: memoize expensive calculations or components only when their inputs stay stable, and virtualize long lists when rendering too many rows is the problem. These techniques address different costs; none makes every kind of large dataset fast by itself.

Measure what is slow before changing the code

Profile the interaction that feels slow, such as typing into a filter, sorting a table, or scrolling a list. Establish whether the browser is spending time transforming data, rendering components, maintaining a large DOM, or receiving and parsing the dataset. The React documentation recommends measuring expensive calculations and profiling rather than assuming a particular row count is too large.

Rendering optimizations do not inherently reduce network transfer or JSON parsing costs. If loading the data is the bottleneck, investigate the size and delivery of the response or whether the application should fetch smaller portions of it. If the delay happens after data is already available, focus on the work triggered by the interaction.

  • Repeated computation: filtering, sorting, mapping, or building derived data runs again unnecessarily.
  • Repeated component work: rows or subtrees render even though their meaningful inputs did not change.
  • Too many DOM nodes: the view tries to render far more rows or columns than are visible.
  • Data loading: transfer, parsing, or keeping the full dataset in browser memory is the limiting factor.

Use useMemo for expensive derived data

useMemo caches the result of a calculation between renders. React compares each dependency with its previous value using Object.is. If every dependency compares equal, React can reuse the cached result; if one changes, it recalculates.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This can help when an expensive filter or transformation runs repeatedly over a large array while its inputs remain stable. It is not a general-purpose data cache, and the component must still work correctly if React recalculates the value. React’s useMemo reference puts the rule plainly: “You should only rely on useMemo as a performance optimization.”

Keep dependencies stable

A newly created object or array is a different dependency even if its contents look identical. For example, constructing a fresh options object during every render can cause a memoized calculation to run each time. Depend on stable values where possible, and avoid adding memoization around trivial work without evidence that it matters.

Use memo when expensive children receive unchanged props

memo can let React usually skip rendering a component when its props have not changed. By default, React compares each prop with Object.is. If a parent creates a new object, array, or function on every render, that prop appears changed and can defeat the optimization.

It is most useful when a component renders frequently with the same props and its rendering is expensive. It is not a guarantee that React will skip a render. Keep state close to the components that need it and keep render logic pure; reducing unnecessary updates at the source is often simpler than wrapping every row in memo. See React’s memo reference for its behavior and limitations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Account for React Compiler in current projects

React’s React Compiler documentation says the compiler can automatically apply memoization to components and certain calculations in React components and hooks. Its goal is to reduce cascading renders and repeated calculations, but it does not memoize every arbitrary function, and memoization is not shared across separate components or hooks.

React recommends relying on the compiler for most new code where it is available, while retaining manual memoization when precise control is needed. In an existing project, check compatibility and setup against the current documentation and test carefully before removing established memoization. Compiler setup and capabilities depend on the project; do not assume that adding the compiler makes unrelated data-loading or DOM costs disappear.

Virtualize when the DOM is the bottleneck

Virtualization renders the items in or near the visible region, plus a small overscan buffer, instead of creating DOM nodes for every row or column. It is useful for long lists and tables when profiling points to DOM size or rendering all items as the problem. For small tables, ordinary rendering is simpler and is generally preferable.

TanStack Table handles table state and row models such as sorting and filtering; it does not automatically virtualize the rendered content. TanStack Virtual’s React adapter provides tools such as useVirtualizer and useWindowVirtualizer to determine which items to render. The page identifies its documentation as latest v3, and its options can vary by version, so check the API against the version installed in your application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Virtualization keeps the rendered DOM smaller, but it does not remove the full client-side dataset from browser memory. If all the data should not be loaded into the browser, use server-side pagination, filtering, or sorting, or load additional data as needed with an approach such as infinite scrolling. Client-side virtualization and server-side data operations solve different problems and can be combined.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep table data and columns stable

For TanStack Table, changing the identity of the data reference can invalidate the core row model, rebuild row and cell objects, and cause downstream sorting, filtering, grouping, or pagination work to run again. Recreating columns can also trigger avoidable work. Unstable references may interact with auto-reset behavior and contribute to repeated render loops.

Keep data and column references stable when their contents have not changed. Depending on the application, that can mean storing them in state, memoizing derived values, defining static columns at module scope, or using a state-management library. When content does change, update data immutably; where the architecture permits, retain references to unchanged items. TanStack’s table FAQ explains the stable-reference failure mode and patterns for avoiding it.

Choose the optimization by the cost it addresses

Approach Cost addressed What needs to stay stable Important limit
useMemo Repeated derived calculations All dependencies must compare equal with Object.is It is an optimization, not a correctness guarantee or general data cache.
memo Repeated rendering of a component Props must compare equal; freshly created objects and functions can invalidate reuse React may still render the component.
React Compiler Many component and hook memoization cases Depends on supported project setup and compiler analysis It does not memoize arbitrary functions or share memoized values across components.
Virtualization DOM size and rendering visible items Virtualizer inputs and rendering behavior must fit the list or table The full client-side dataset still occupies browser memory.
Server-side operations Loading or processing a dataset too large for the client Server request and pagination/filtering state Requires data operations to be handled through the server rather than solely in the browser.

These approaches can be combined, but start with the measured bottleneck. A filtered table might benefit from a cached derived calculation and stable table references; a very long result set might also need virtualization. If the application should not hold all records in memory, reduce or page the data at the server rather than expecting virtualization to solve loading.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.