100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
React Native
32 minintermediate

Images, Assets and Media Performance

A screen that renders instantly in the simulator can still stutter on a mid-range Android device the moment it scrolls past a dozen product photos, and the cause is almost never the JavaScript. It is the native image pipeline: every image on screen has to be fetched or read from disk, decoded from a compressed format into raw pixel data, and held in memory at its decoded size, which for a full-resolution photo can be tens of megabytes even though the on-screen thumbnail is a few hundred pixels wide. A feed that decodes twenty full-resolution photos to display twenty thumbnails is not a rendering problem to fix with re-render discipline — it is a decoding and memory problem that lives entirely outside the component tree this course has spent several lessons optimizing.

The failure mode is specific and repeatable: memory climbs as a list scrolls, frame drops appear right as new images enter view, and on lower-memory Android devices the OS eventually kills the app in the background because it holds more decoded image data than the device is willing to keep resident. None of this shows up in a profiler that only watches JavaScript execution, because the decode work happens on the native side, off the JS thread, which is exactly why teams that never learned to reason about image cost ship apps that pass every component-level performance review and still get one-star reviews for lagging on a product grid.

This lesson treats an image as a resource with a real, quantifiable cost — network bytes, decode time, and resident memory — and treats every choice about it (source, size, format, caching, and when it loads) as a decision that trades one of those costs against another. Getting this right is what separates a feed that feels instant from one that feels like it is fighting the device for every scroll.

Analogy🏏Cricket
🏏 Think of it like cricket: A broadcaster covering a full IPL season does not pull the original, full-resolution camera feed from every one of its ten venues into the studio at once just because the footage exists — the technical director decides, for each shot, exactly what resolution and bitrate the moment actually needs, because pulling everything at maximum quality would overwhelm the studio's bandwidth and storage long before a single highlight package gets cut. A slow-motion replay of a Jasprit Bumrah yorker deserves the highest resolution the broadcast can carry, because the moment is the whole point of the shot; a wide static shot of the outfield between overs does not, because nobody is scrutinizing grass at full detail. Just as the technical director matches each feed's resolution to what that specific shot needs rather than defaulting every feed to maximum quality, an app should decode and hold each image at the resolution its specific placement on screen actually needs, not at whatever resolution the source file happens to be. Just as pulling every feed at full quality would exhaust the studio's capacity long before broadcast, decoding every image at full resolution exhausts a phone's memory long before a user finishes scrolling a feed. The insight is that resource cost should be matched to actual on-screen need at the point of decision, not deferred to whatever the source happened to provide — the broadcast that scales each feed deliberately stays smooth across a full season; the app that decodes indiscriminately runs out of room by the second screen.
Lesson 13 of 35
0% complete