Performance
508 bites tagged Performance — interview questions with model answers, and 60-second explainers.
Flexible Images: More Than Just `max-width`
Flexible images adapt to the device by providing different resolutions or crops. Use `srcset` for high-DPI screens and `<picture>` for art direction. The footgun is relying only on CSS `max-width`; this forces mobile users to download unnecessarily large…
CSS Filter: Photoshop-like Effects in the Browser
The `filter` property brings Photoshop-like graphical effects directly into CSS. Use it for image adjustments like `blur()` or `contrast()`, or for complex shadows with `drop-shadow()`. The order of chained filters matters, as they are applied sequentially.
Variable Fonts: One File, Infinite Styles
Variable fonts pack an entire typeface's variations—from thin to bold, condensed to wide—into a single file. This avoids multiple HTTP requests for different font weights, giving you a continuous range of styles with CSS.
CSS Gradients: Dynamic Images from Code
Think of CSS gradients as dynamic images generated by the browser, creating color transitions without a separate file. Use them for backgrounds and buttons. The default direction is top-to-bottom, but a `0deg` angle is counterintuitively bottom-to-top.
Serverless Cold Starts: The Price of 'Pay-per-Use'
A serverless cold start is the initial delay when a function boots from scratch, like waking a computer from being off versus asleep. It happens on the first request or after inactivity.
Managed In-Memory Data Store: Speed Without the Sysadmin
A managed in-memory store is a high-speed valet for your data, sitting between your app and database to serve requests at microsecond latency. Use it for database acceleration or session stores. The footgun is treating it as a permanent database.
CDN Edge Computing: Code at the Cache
CDN Edge Computing runs your code at the network edge, not just caches files. It's for low-latency tasks like A/B testing or auth checks. The footgun is treating it like a full backend; it's stateless and resource-constrained.
Content Delivery Network (CDN): Serving Content from the Edge
A CDN is like a global chain of convenience stores for your website's assets. It caches copies closer to users for faster delivery, speeding up images, CSS, and video. The footgun: accidentally caching private user data and serving it to everyone.
Pipeline Analytics: Measuring Your CI/CD Health
Pipeline analytics is a fitness tracker for your CI/CD, revealing if builds are getting slower or less reliable. Use it to spot bottlenecks, track failure rates, and compare branches. The footgun is ignoring the P95 duration, which hides worst-case outliers.
Real User Monitoring (RUM): See Your App Through Users' Eyes
Real User Monitoring (RUM) is like a flight recorder for your app, capturing real user clicks, load times, and errors. It's used to measure actual performance and diagnose slowdowns, revealing issues that lab testing misses.
Software Performance Testing: How a System Behaves Under Stress
Performance testing answers 'how does it work under load?' It simulates user traffic to measure a system's responsiveness, stability, and resource use. The footgun is testing unrealistic scenarios instead of finding real-world breaking points.
ProGuard Keep Rules: A "Do Not Remove" List for Your Code
ProGuard keep rules are a "do not remove" list for Android's code shrinker, telling it what to spare when it can't detect usage. This is crucial for code accessed via reflection or JNI.
Android Overdraw: Stop Painting Pixels Twice
Overdraw is wasted GPU work, painting the same pixel multiple times in one frame. It causes UI stutter and drains battery. Fix it by removing unneeded backgrounds and flattening your UI layouts.
Google Play Dynamic Delivery: Ship Features On-Demand
Shrink your app's initial install size by delivering features on-demand. Instead of one giant APK, Dynamic Delivery sends a small base app, then downloads larger features like AR modes or special tools only when the user needs them.
Android App Bundles: Ship Less Code to Users
Instead of one giant APK, an Android App Bundle (AAB) lets Google Play build a smaller, custom APK for each user's device. This standard publishing format reduces app size and speeds up installs by delivering only the necessary components.
Perfetto: See Your Whole System on One Timeline
Perfetto is a flight recorder for your system, capturing kernel and app events on a single timeline. Use it to diagnose complex issues like jank by correlating app behavior with system activity.
Android Baseline Profiles: Pre-compiling for Speed
A Baseline Profile is a cheat sheet for the Android runtime, telling it which code to pre-compile for faster performance. This speeds up app startup and reduces UI jank in critical flows.
Android App Startup: From Cold to Hot
App startup has three types: cold, warm, and hot. Optimization focuses on the cold start—when the app launches from scratch. This is critical for user retention, as slow launches are a common reason for uninstalls. The footgun: don't just test warm starts.
Memory Leaks: The Silent App Killer
A memory leak is when your app holds onto objects it no longer needs, preventing memory reclamation. This often happens with static references to UI elements or background tasks. The footgun: your app won't crash immediately, but will slow down and die later.
StrictMode: Your Main Thread's Watchdog
StrictMode is a developer tool that acts like a strict supervisor for your app's main thread, catching slow operations like disk or network access. It helps you find performance issues before they cause "Application Not Responding" errors.
JobScheduler: Efficient, Deferrable Background Tasks
Think of JobScheduler as Android's smart alarm for tasks. You specify conditions like 'Wi-Fi only' or 'charging,' and the OS runs your job efficiently to save battery. Use it for deferrable work like data syncs. Footgun: It's not for exact timing.
Lazy Layouts: Compose's Answer to Efficient Lists
Lazy layouts in Jetpack Compose render only the list items visible on screen, avoiding memory crashes from large datasets. Use them for long lists like feeds or galleries, but remember to provide a `key` to prevent UI glitches when data changes.
RecyclerView: Efficiently Displaying Dynamic Lists
RecyclerView displays long lists by recycling views that scroll off-screen, like a restaurant reusing plates for new customers. It's essential for feeds or contact lists.
ConstraintLayout: Flexible UIs Without Nesting
ConstraintLayout positions UI elements by their relationships, like anchoring objects on a blueprint. It's ideal for responsive screens that avoid deep, slow view hierarchies.
Get Performance bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.