Engineering React Performance Vite

React Performance Optimization for Educational Platforms: From 8s to Under 1s

10 min readWANOVA

One of our clients launched an educational platform that started losing students on day one. The culprit: an 8.2-second load time on mobile. This article documents exactly what we changed to get it below 1 second — not theory, not a translated best-practices list, but specific changes to a production React codebase.

Code Splitting: Don't Load What the User Can't See Yet

Most React apps load the code for every page all at once. The login page loads code for the dashboard, course viewer, settings, and admin panel — even though the user doesn't need any of it yet. The fix: React.lazy() with Suspense.

  • Use React.lazy() for every major route: const Dashboard = lazy(() => import('./Dashboard'))
  • Add Suspense with a lightweight fallback — a simple spinner beats a white screen
  • Vite does route-level Code Splitting automatically — use it before anything else
  • Heavy video player? Load it lazily only when the user actually starts playing
  • Real result: we reduced initial bundle size by 67% with Code Splitting alone
→ Rule: anything below the fold can load lazily. Users don't notice delayed loading of content they can't see — only of what's in front of them.

Preventing Re-renders: React.memo, useMemo, and useCallback

The most common mistake: adding React.memo to everything. This actually slows your app down because the comparison itself has a cost. React.memo is useful only when:

  • The component re-renders frequently even though its props haven't changed
  • The component is computationally expensive: large data tables, complex charts
  • The component appears in a long list of similar items (100+ items)
  • useMemo: for heavy calculations only — filtering 10,000 records, aggregating statistics
  • useCallback: for event handlers passed to memoized child components
→ Rule: measure first, then optimize. React DevTools Profiler shows which components re-render and why. Never add memo without a measurement to justify it.

Virtual Lists: 1,000+ Items Without a Slowdown

Teacher admin panel showing 800 students? Course list with 300 units? Rendering every element in the DOM kills memory and freezes the browser. Virtualization renders only what's currently visible on screen — the rest is computed on demand.

  • @tanstack/react-virtual: lightest and most flexible — only 6KB
  • react-window: simpler API for straightforward list cases
  • Without virtualization: rendering 1,000 rows = 200ms + massive RAM consumption
  • With virtualization: rendering 20 visible rows = 4ms
  • Rule of thumb: add virtualization to any list that exceeds 50-100 items

Image Optimization: WebP and Lazy Loading

Course thumbnails and profile photos are a major source of page bloat. On an average educational platform, images account for 60-70% of page weight.

  • Convert all images to WebP — 25-30% smaller than JPEG at the same quality
  • Add loading='lazy' to every image not in the initial viewport
  • Use srcset for responsive images — don't send a 2000px image to a 400px screen
  • Blur placeholder with base64 improves UX while large images load
  • Cloudinary or imgix for automatic conversion per device — worth the subscription

Bundle Analysis: Find the Hidden Weight

Before any optimization, understand what's in your bundle. A 200KB charting library for one simple graph? moment.js at 67KB to format a single date? These exist in most real projects.

  • Vite: use rollup-plugin-visualizer for a visual bundle map
  • Replace moment.js with day.js — same functionality at 2KB instead of 67KB
  • lodash imports: use import { debounce } from 'lodash-es', not the full package
  • Icon libraries: import individual icons, not the entire icon set
  • Check tree shaking support before adopting any new library
→ Removing moment.js from one production project saved 62KB — equivalent to 0.3 seconds of load time on an average 4G mobile connection.

Measuring Real-World Performance: Core Web Vitals

Lighthouse numbers are useful but don't always reflect real user experience. Use these tools to measure LCP, CLS, and INP from actual browser sessions:

  • web-vitals (Google): 2KB, measures real browser performance and sends to analytics
  • Sentry Performance: automatically collects data from real users with full context
  • Google Search Console: Core Web Vitals from your actual users — more important than Lighthouse
  • Good LCP: < 2.5s | Good CLS: < 0.1 | Good INP: < 200ms
MetricGoodNeeds WorkPoor
LCP (Largest Contentful Paint)< 2.5s2.5s – 4s> 4s
INP (Interaction to Next Paint)< 200ms200ms – 500ms> 500ms
CLS (Cumulative Layout Shift)< 0.10.1 – 0.25> 0.25

Free 30-minute consultation

Get an initial concept for your platform.

شعار وانوفا WANOVA

Built for the future. Premium digital platforms and cinematic software solutions.

Quick Links

© 2026 WANOVA. All rights reserved.