React Chart Performance: A Checklist for Charts That Lag Past 10,000 Points

TL;DR: A React chart that lags past 10,000 points is usually paying one of four bills: too many React renders, a growing array copied on every update, too many marks for the renderer, or CPU-side drawing that a GPU could take over. This checklist shows how to find your bill with the React Profiler and the browser Performance panel, then gives the fix for each in the order worth trying. It ends with a pattern that sends data straight to the chart and keeps React state out of the update path.
A chart that looks fine with a sample file can fall apart the first time real data arrives. Nothing in the code changed, only the number of points, and suddenly hovering stutters, the tab uses a full CPU core, and the feed starts lagging behind the sensor.
Most of the advice online jumps straight to "switch libraries," which skips the useful step of finding out what is slow. This post gives you six checks to run in order, each with a symptom, a way to confirm it, and a fix. By the end you will know how to tell a React problem from a chart library problem, which fixes are cheap enough to try first, and when sending data around React entirely is the right move.
How One Telemetry Feed Reaches the Screen Through Three Stages
Suppose we have a telemetry dashboard that receives about 20 readings per second over a WebSocket and plots the latest 50,000 points in a line chart. Every reading goes through the same three stages, and any of them can be the one that stalls.
- React renders. Your components run again and React compares the new output with the old one.
- The library prepares the data. It parses, scales, and copies what it was handed.
- Something draws. The browser paints SVG elements, a library repaints a canvas, or a GPU renderer built on WebGL or WebGPU uploads buffers.
The drawing stage scales differently depending on the technology. SVG keeps each mark as an element in the page, so the browser lays out and styles every one. Recharts, for example, is built on SVG elements. Canvas is one bitmap that the library repaints, which is the model behind Chart.js. WebGL and WebGPU hand the work to the GPU.
A 60 Hz display leaves roughly 16.7 milliseconds per frame, and all three stages have to fit inside it. Some of that work is fixed, because your components cost about the same with 500 points as with 50,000. The rest grows with the dataset, and past a certain size it crowds out the frame.
In the telemetry example, a chart holding 50,000 points that refreshes 20 times a second makes the library handle 1,000,000 points per second, even though only 20 are new.
Neither React nor the libraries named in this post publish a point count where this breaks. Symptoms commonly show up around 10,000 points in unoptimized setups, and Check 1 helps you find your own number.
Check 1: Measure Which Stage Is Slow Before Changing Code
Guessing wastes days. React ships a tool that narrows it down: the <Profiler> API reports actualDuration, the time spent rendering the profiled tree for one update, and baseDuration, an estimate of the same render with no memoization at all. If the two are close, memoization is not helping. The Profiler tab in React Developer Tools shows the same thing without code changes.
Two cautions before you trust the numbers:
- Profiling is off in the production build by default, so measuring production behavior needs a profiling build.
- In development, Strict Mode calls your render function twice, so a development build can look slower than production will.
Two readings explain most cases:
- Long render durations on every update, with
actualDurationnearbaseDuration. React is re-rendering more than it should. Go to Check 2. - Short React commits, but long frames in the browser's Performance panel. The time is going into data preparation or drawing. Go to Checks 4 and 5.
Check 2: Stop Re-rendering the Chart on Every Message
By default, React re-renders all of a component's children recursively when the component re-renders. If the WebSocket handler stores readings in state near the top of the page, each of the 20 updates per second re-renders the header, the sidebar, the tables, and the chart.
The usual defense has two parts:
- Keep state in the smallest component that needs it.
- Wrap the chart in
memo, which skips a re-render when props match the last render.
Add memo only after you have confirmed a re-render is slow. It also fails more often than you would expect, because an expression like filterTodos(todos, tab) creates a new array every time, just as a {} literal creates a new object, so the memoized child never sees equal props.
Chart components are prone to this because their props are objects: an inline options literal, a data array rebuilt during render, a callback created fresh each time.
In Recharts, a changing dataKey makes the library recalculate all the points for that component, so an inline dataKey function belongs outside the component.
import { memo, useMemo } from "react"; import { Line } from "react-chartjs-2"; // Defined once at module level, so the reference never changes. const chartOptions = { animation: false }; const ChartPanel = memo(function ChartPanel({ points }) { const data = useMemo( () => ({ datasets: [{ label: "Sensor A", data: points }] }), [points] ); return <Line data={data} options={chartOptions} />; }); Hover is a smaller version of the same problem. Pointer events fire far more often than data arrives, so a parent that stores the hovered series or tooltip position in state re-renders the chart on every mouse move.
Keep hover state in a small component of its own so only that component re-renders. In react-chartjs-2, also give each dataset a unique label or a datasetIdKey, because re-renders can otherwise merge datasets.
Check 3: Stop Copying the Whole Array for Each New Reading
React expects array state to be treated as read-only, so the usual way to add an item is to build a new array with spread syntax:
setPoints((prev) => [...prev, reading]); With 50,000 points and 20 readings per second, that line copies about a million elements every second, produces a new reference each time, and lets the array grow without a limit. Engines copy arrays quickly, so the copy itself is rarely the worst part.
The larger costs sit downstream: every new reference tells the chart its data changed, and every discarded array adds garbage-collection pressure.
The fix is to decouple the feed's message rate from React's render rate. Collect readings in a ref, flush them into state once per animation frame (requestAnimationFrame runs your code just before the browser's next paint), and cap the window.
const MAX_POINTS = 50_000; function useTelemetry(feed) { const [points, setPoints] = useState([]); const pending = useRef([]); useEffect(() => { // feed.subscribe is your own data source wrapper and returns an unsubscribe function. const unsubscribe = feed.subscribe((reading) => pending.current.push(reading)); let frame; const flush = () => { if (pending.current.length > 0) { const batch = pending.current; pending.current = []; setPoints((prev) => prev.concat(batch).slice(-MAX_POINTS)); } frame = requestAnimationFrame(flush); }; frame = requestAnimationFrame(flush); return () => { unsubscribe(); cancelAnimationFrame(frame); }; }, [feed]); return points; } Now renders and copies happen at most once per frame, however fast the feed is. The window stays bounded, so memory stops growing.
Check 4: Draw Fewer Elements per Point in SVG or Canvas
Once the library has the data, its rendering model sets the price of each point. In SVG the price includes page elements. Recharts' Line component shows how fast that adds up: dot defaults to true, which renders a circle at every data point, and isAnimationActive defaults to "auto", so animation is on in the browser unless the user prefers reduced motion. For 50,000 points that is up to 50,000 circles for the browser to lay out. Switching off dots and animation removes most of it:
<Line dataKey="value" dot={false} isAnimationActive={false} /> Canvas drops the per-element cost but keeps the processing cost. These Chart.js performance settings are worth checking:
-
parsing: falseskips parsing when your data is already in the internal format. -
normalized: truedeclares that the data is sorted with unique, consistent indices. -
animation: falseis recommended when render times are long. -
pointRadius: 0hides point markers.
Each one removes work that scales with point count. Neither Recharts nor Chart.js publishes a point count at which SVG or canvas becomes unusable, so test with your own series count and hardware before settling on a limit.
Check 5: Send Fewer Points Than the Screen Has Pixels
A line chart 1,000 pixels wide has 1,000 horizontal positions. Past one point per pixel, extra points overlap. They still cost parsing, scaling, and path-tracing time while adding almost nothing the viewer can see. Closing that gap is the largest lever on draw cost, and it improves as the dataset grows.
Chart.js ships a decimation plugin for this. Decimation sends the chart fewer points, chosen to keep the shape of the line.
- LTTB (largest triangle three buckets), the default, outputs about one sample per pixel of canvas width and suits trend viewing.
- Min-max preserves peaks but can need up to four points per pixel.
The plugin needs a line dataset on a linear or time x-axis with parsing set to false. Decimating the data yourself before it reaches the chart beats letting the plugin do it during drawing.
import { useMemo } from "react"; import "chart.js/auto"; // registers all Chart.js components import { Line } from "react-chartjs-2"; const options = { parsing: false, normalized: true, animation: false, elements: { point: { radius: 0 } }, scales: { x: { type: "linear" } }, plugins: { decimation: { enabled: true, algorithm: "lttb", samples: 500 }, }, }; export function TelemetryChart({ points }) { // points: [{ x: 1700000000000, y: 42.1 }, ...], sorted by x const data = useMemo( () => ({ datasets: [{ label: "Sensor A", data: points, borderWidth: 1 }] }), [points] ); return <Line data={data} options={options} />; } Decimation trades fidelity for speed, so pick the algorithm against what the chart must show. A monitoring view that can never hide a spike should use min-max.
Chart.js can also render in a web worker through OffscreenCanvas, but functions cannot be transferred, DOM-dependent plugins and mouse interactions will likely fail, and config and data transfers are costly.
Check 6: Move the Data Path Out of React Entirely
Suppose the dashboard still needs more points or faster updates than a canvas chart can sustain after Checks 2 to 5. The remaining costs are structural: data still flows through React state, and the library still repaints from CPU-side work. The last option is a GPU renderer fed directly, with React responsible only for mounting and unmounting the chart.
SciChart.js is one such library, and this post is published for SciChart, so weigh it as one option next to the cheaper fixes above. Its v6 engine combines WebAssembly with WebGPU and WebGL rendering, so charts are GPU-accelerated wherever the browser allows it.
The scichart-react package wraps the chart lifecycle in a component and handles initialization and cleanup. One rule applies: initChart runs only for the initial render, so it must not change between renders. That is the stable-props discipline from Check 2, enforced by the component.
Data then goes straight into the chart through the DataSeries API:
-
appendRangetakes a batch of points in one call, which SciChart recommends over single-point appends. -
fifoCapacitymakes the series discard the oldest points once it is full (first in, first out). SciChart handles FIFO series internally as a circular buffer, which replaces the capped window and array copying from Check 3. - Redraws are throttled to at most one every 1/60th of a second regardless of how often you update, which does the batching the animation-frame hook did by hand.
import { useCallback } from "react"; import { SciChartReact } from "scichart-react"; import { EAutoRange, FastLineRenderableSeries, NumericAxis, SciChartSurface, XyDataSeries, } from "scichart"; import { feed } from "./feed"; // your own data source wrapper SciChartSurface.loadWasmFromCDN(); const FIFO_CAPACITY = 50_000; export function TelemetryChart() { const initChart = useCallback(async (rootElement: string | HTMLDivElement) => { const { sciChartSurface, wasmContext } = await SciChartSurface.create(rootElement); sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { autoRange: EAutoRange.Always })); sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { autoRange: EAutoRange.Always })); const dataSeries = new XyDataSeries(wasmContext, { fifoCapacity: FIFO_CAPACITY }); sciChartSurface.renderableSeries.add( new FastLineRenderableSeries(wasmContext, { dataSeries }) ); // Hand the series to onInit. return { sciChartSurface, dataSeries }; }, []); return ( <SciChartReact initChart={initChart} onInit={({ dataSeries }) => // Subscribe only after the chart is ready. The returned unsubscribe // function runs before the chart is deleted. feed.subscribe(({ x, y }: { x: number[]; y: number[] }) => { dataSeries.appendRange(x, y); }) } style={{ width: "100%", height: 400 }} /> ); } A few details in that snippet are easy to miss:
- The subscription starts in
onInitrather thanuseEffect, because an effect can fire long before the asynchronous chart setup finishes. - The axes use
EAutoRange.Always. The default isOnce, which ranges the axis a single time and would leave the view stuck on the first data. - A FIFO series supports only
append,appendRange,update, andclear, so inserts and removals in the middle are not available in this mode. - Install
scichart6.0.13 or later alongsidescichart-react2.x, since the wrapper lists that as its peer range.
React does nothing per update in this arrangement, so the re-render multiplier no longer touches the chart data. Whether the GPU draw hits your frame rate depends on dataset size, series count, and hardware, so run it inside your own application under your own update load before committing. Published figures from any vendor, SciChart included, are no substitute for that test.
SciChart's Community Edition is free for personal, educational, and non-commercial use and shows a watermark. Commercial projects need a paid licence, priced per developer on the SciChart shop.
Where Should You Start With Your Own Chart
Lag past roughly 10,000 points comes from a cost that grows with the dataset and gets paid more often than it should. React triggers the work too frequently when state sits too high, props are unstable, or every update copies the full array. The chart library pays per point, in SVG elements or canvas processing, including points nobody can tell apart on screen. Profiling a production build shows which side you are on, and each fix before Check 6 is cheap enough to try before touching your dependencies.
If the profiler still points at the draw stage after those fixes, run your own streaming workload through a GPU renderer and compare it with your current setup on identical data. The SciChart.js getting-started guide walks through installation and a first chart, and the scichart-react repository linked above holds the React wrapper. I first laid out a shorter version of this checklist on daily.dev. If you want a specific check unpacked further, tell me which one in the comments.
Frequently Asked Questions About React Chart Performance
At what point do React charts start lagging?
There is no fixed number. It depends on the library, the number of series, the update rate, and the device. Around 10,000 points is where symptoms commonly appear, but several series with fast updates can stall earlier, and a static chart can run well beyond it. Profile your own case to find your number.
Does wrapping a chart in React.memo fix the lag?
Only when its props are stable. A prop that is a new object on every render, such as an inline options literal or a freshly mapped array, is enough to defeat memo for the whole component. Stabilize props with useMemo or module-level constants first.
Should chart data live in useState?
For small or slow-changing data, yes. React treats state arrays as read-only and replaces them on each update, which gets expensive for large, fast series. For streams, batch readings per animation frame and cap the window, or send data directly to the chart library's own data API.
Is canvas always faster than SVG for large datasets?
Canvas avoids one DOM element per mark, which is the main SVG cost at high point counts. It still pays for data processing and repainting, which is why Chart.js documents decimation, parsing: false, and disabling animation. The result depends on the library and the workload.
Does the React Compiler make manual memoization unnecessary?
It automates much of it. React Compiler 1.0 reached stable on October 7, 2025, and the release post recommends relying on it for new code while keeping useMemo and useCallback as an escape hatch, particularly for effect dependencies. The compiler decides which components re-render. It does not reduce the number of points a chart library must process.
How do I stream data into a SciChart.js chart in React without re-rendering?
Create the chart once with scichart-react, return the XyDataSeries from initChart, and start your subscription in onInit so it begins only when the chart is ready. Call appendRange from that subscription, and give the series a fifoCapacity so old points drop off automatically. No React state is involved in the update.
Does Strict Mode slow my chart down in production?
No. Strict Mode's checks, including double rendering and the extra effect cycle, run in development only and do not affect the production build. They can make a development build look slower than production.


