0Pricing
React Native Academy · 강의

Flipper 및 React DevTools로 프로파일링하기

실행 중인 앱을 Flipper에 연결하고 React DevTools 플러그인으로 컴포넌트 트리를 검사하며, 렌더링 추적을 기록하고 불필요하게 다시 렌더링되는 컴포넌트를 찾습니다.

Flipper 및 React DevTools로 프로파일링하기은(는) CoddyKit의 무료 React Native Academy 강의입니다. 이것은 4개 중 1번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 React Native Academy 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. React Native Academy 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Why Performance Profiling Matters

React Native apps can suffer from dropped frames, slow list scrolling, long startup times, and excessive memory use — all of which frustrate users. Before optimizing, you must measure to understand where the bottleneck actually is, rather than guessing and making speculative changes.

The two primary profiling tools for React Native are Flipper (a native debugging platform) and React DevTools (which includes a component profiler). Used together, they give you visibility into both the JS thread performance and the component render tree.

Setting Up Flipper

Flipper is a desktop application by Meta that connects to running React Native apps over USB or a network and displays real-time debugging data. Download it from fbflipper.com and install it on your development machine.

Flipper works out of the box with React Native CLI projects on physical devices and simulators. For Expo apps, you need to use a development build (not Expo Go). Once connected, Flipper's sidebar shows available plugins including React DevTools, Network Inspector, Hermes Debugger, and Layout Inspector.

The React DevTools Plugin

The React DevTools plugin in Flipper lets you inspect the component tree in real time. You can select any component to see its current props, state, and hooks values in the right panel. This is invaluable for debugging why a component is rendering with unexpected values.

You can also use the standalone react-devtools package: install it globally with npm install -g react-devtools, then run react-devtools and shake your device to open the developer menu and connect.

# Install standalone React DevTools
npm install -g react-devtools

# Start the DevTools server
react-devtools

# In your app, shake the device and tap 'Open Debugger'
# OR in the Metro bundler terminal, press 'd' to open the dev menu

The React Profiler: Recording Renders

Inside React DevTools, the Profiler tab records which components rendered and how long each render took. Click Record, interact with the app (scroll a list, type in a field, tap a button), then click Stop. The flame graph shows each render, color-coded from yellow (slow) to blue (fast).

Each bar in the flame graph represents a component re-render. Taller bars indicate more time spent rendering. Clicking a bar shows the render duration in milliseconds and which props or hooks changed to trigger the re-render.

Identifying Unnecessary Re-Renders

A common performance issue is components that re-render when their props or state have not actually changed. In the React Profiler, look for components that appear in every flame graph frame even when the user is not interacting with them — these are candidates for memoization.

You can also enable the Highlight updates option in React DevTools. Every time a component re-renders, it flashes with a colored border on the screen. Green means a fast render, yellow means slow. Seeing the entire screen flash on a single button press is a sign of excessive re-renders.

The Layout Inspector and Network Tab

Flipper's Layout Inspector shows the native view hierarchy, similar to the iOS View Debugger or Android Layout Inspector. You can tap any element in the inspector to highlight it on the device and inspect its native layout properties.

The Network Inspector shows all HTTP requests made by the app, including headers, body, and response. This is useful for catching redundant API calls, unexpected slow endpoints, or misconfigured caching headers that cause data to be re-fetched unnecessarily.

Hermes and JS Thread Performance

React Native uses Hermes, a JavaScript engine optimized for mobile, as the default engine since React Native 0.70. Hermes pre-compiles JavaScript to bytecode at build time, dramatically reducing startup time. Flipper's Hermes Debugger lets you profile CPU usage and inspect memory allocations in the JS heap.

To profile JS thread performance, use the Hermes Debugger's Timeline tab. Record a session, then look for long JavaScript tasks that block the UI thread. Tasks longer than 16ms cause dropped frames (below 60fps).

Measuring FPS with Performance Monitor

The React Native built-in Performance Monitor (accessible from the developer menu) shows real-time frames per second. Two FPS counters are displayed: the JS FPS (how fast JavaScript executes) and the UI FPS (how fast frames are rendered natively).

The target is 60 FPS for both. If JS FPS drops but UI FPS stays high, the bottleneck is JavaScript logic. If UI FPS drops while JS FPS is high, the bottleneck is in the native rendering layer — often caused by too many Views or complex shadows.

Using console.time for Microbenchmarks

For quick measurements of specific operations — like how long it takes to process an API response or filter a large array — use console.time and console.timeEnd. These are available in Hermes and work in the Metro/Flipper console.

This is useful for identifying expensive data transformations that could be moved off the JS thread, memoized, or simplified before rendering a list.

// Measure array sorting performance
console.time('sortPosts');
const sorted = posts.sort((a, b) => b.createdAt - a.createdAt);
console.timeEnd('sortPosts'); // e.g., 'sortPosts: 3.14ms'

// Measure a network call
console.time('fetchUser');
const user = await fetchUserById(userId);
console.timeEnd('fetchUser'); // e.g., 'fetchUser: 245ms'

Why You Measure Before You Optimize

A common mistake is to apply memoization (React.memo, useCallback, useMemo) everywhere as a precaution. This actually adds cost — memoization runs comparison functions on every render, and for simple components the comparison may cost more than just re-rendering.

The rule is: profile first, then optimize where the profiler shows a real bottleneck. The React Profiler's Why did this render? panel tells you the exact props or hooks that changed for each component, so you know precisely what to memoize.

Performance Monitoring in Production

Development profiling with Flipper only shows performance on your machine. For production insights, integrate a performance monitoring tool like Firebase Performance Monitoring or Sentry Performance. These capture real user metrics including app startup time, screen render duration, and HTTP request latency.

Use perf().startTrace('my-operation') from Firebase Performance to instrument specific flows and see timing data broken down by country, device, and app version in the Firebase console.

import perf from '@react-native-firebase/perf';

async function loadFeed() {
  const trace = await perf().startTrace('load_feed');

  try {
    const data = await fetchFeedData();
    setFeed(data);
    trace.putMetric('item_count', data.length);
  } finally {
    await trace.stop(); // Records duration to Firebase
  }
}

Quick Check

Test your understanding of React Native Mobile Development concepts from this lesson.

Lesson Recap

In this lesson you learned: how to use Flipper and the React DevTools Profiler to record component renders, how to identify unnecessary re-renders using the Highlight Updates overlay, and why you should always measure with profiling tools before applying optimizations. Next up we apply memoization techniques with React.memo, useCallback, and useMemo to eliminate the bottlenecks we discovered.

자주 묻는 질문

“Flipper 및 React DevTools로 프로파일링하기” 강의는 무료인가요?

네 — “Flipper 및 React DevTools로 프로파일링하기” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 React Native Academy 강의 전체를 잠금 해제할 수 있습니다. React Native Academy 강의에는 총 4개의 강의가 포함되어 있습니다.

“Flipper 및 React DevTools로 프로파일링하기”에서 뭘 배우나요?

실행 중인 앱을 Flipper에 연결하고 React DevTools 플러그인으로 컴포넌트 트리를 검사하며, 렌더링 추적을 기록하고 불필요하게 다시 렌더링되는 컴포넌트를 찾습니다. 브라우저에서 직접 실행하는 실습 코드로 React Native Academy을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

React Native Academy을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 React Native Academy은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 1번째 강의입니다.

“Flipper 및 React DevTools로 프로파일링하기” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 React Native Academy 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 React Native Academy 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. Flipper 및 React DevTools로 프로파일링하기
  2. React.memo, useCallback, useMemo를 사용한 메모이제이션
  3. FlatList 성능 조정
  4. 번들 크기 및 지연 로딩
← React Native Academy(으)로 돌아가기