본문 바로가기

11월 26일 21:24 기준 · 10분마다 새 소식을 확인합니다

광고나 제휴로 순서를 바꾸지 않습니다 · pick 기준 보기 ›
소식 받기
코딩 · 개발

모바일 앱 성능 심층 진단

앱 및 서버리스 서버 간 콜드 스타트 지연 시간과 모바일 UX 성능 병목을 정밀 진단할 때 사용합니다.

추천 툴
Claude CodeAI 분류
쓰인 기법
역할 부여 · 제약 조건 설정 · 출력 형식 지정

프롬프트 원문

Act as a Senior Mobile Performance Engineer and Supabase Edge Functions Architect.

Your task is to perform a deep, production-grade analysis of this codebase with a strict focus on:

- Expo (React Native) mobile app behavior
- Supabase Edge Functions usage
- Cold start latency
- Mobile perceived performance
- Network + runtime inefficiencies specific to mobile environments

This is NOT a refactor task.
This is an ANALYSIS + DIAGNOSTIC task.
Do not write code unless explicitly requested.
Do not suggest generic best practices — base all conclusions on THIS codebase.

---

## 1. CONTEXT & ASSUMPTIONS

Assume:
- The app is built with Expo (managed or bare)
- It targets iOS and Android
- Supabase Edge Functions are used for backend logic
- Users may be on unstable or slow mobile networks
- App cold start + Edge cold start can stack

Edge Functions run on Deno and are serverless.

---

## 2. ANALYSIS OBJECTIVES

You must identify and document:

### A. Edge Function Cold Start Risks
- Which Edge Functions are likely to suffer from cold starts
- Why (bundle size, imports, runtime behavior)
- Whether they are called during critical UX moments (app launch, session restore, navigation)

### B. Mobile UX Impact
- Where cold starts are directly visible to the user
- Which screens or flows block UI on Edge responses
- Whether optimistic UI or background execution is used

### C. Import & Runtime Weight
For each Edge Function:
- Imported libraries
- Whether imports are eager or lazy
- Global-scope side effects
- Estimated cold start cost (low / medium / high)

### D. Architectural Misplacements
Identify logic that SHOULD NOT be in Edge Functions for a mobile app, such as:
- Heavy AI calls
- External API orchestration
- Long-running tasks
- Streaming responses

Explain why each case is problematic specifically for mobile users.

---

## 3. EDGE FUNCTION CLASSIFICATION

For each Edge Function, classify it into ONE of these roles:

- Auth / Guard
- Validation / Policy
- Orchestration
- Heavy compute
- External API proxy
- Background job trigger

Then answer:
- Is Edge the correct runtime for this role?
- Should it be Edge, Server, or Worker?

---

## 4. MOBILE-SPECIFIC FLOW ANALYSIS

Trace the following flows end-to-end:

- App cold start → first Edge call
- Session restore → Edge validation
- User-triggered action → Edge request
- Background → foreground resume

For each flow:
- Identify blocking calls
- Identify cold start stacking risks
- Identify unnecessary synchronous waits

---

## 5. PERFORMANCE & LATENCY BUDGET

Estimate (qualitatively, not numerically):

- Cold start impact per Edge Function
- Hot start behavior
- Worst-case perceived latency on mobile

Use categories:
- Invisible
- Noticeable
- UX-breaking

---

## 6. FINDINGS FORMAT (MANDATORY)

Output your findings in the following structure:

### 🔴 Critical Issues
Issues that directly harm mobile UX.

### 🟠 Moderate Risks
Issues that scale poorly or affect retention.

### 🟢 Acceptable / Well-Designed Areas
Good architectural decisions worth keeping.

---

## 7. RECOMMENDATIONS (STRICT RULES)

- Recommendations must be specific to this codebase
- Each recommendation must include:
  - What to change
  - Why (mobile + edge reasoning)
  - Expected impact (UX, latency, reliability)

DO NOT:
- Rewrite code
- Introduce new frameworks
- Over-optimize prematurely

---

## 8. FINAL VERDICT

Answer explicitly:
- Is this architecture mobile-appropriate?
- Is Edge overused, underused, or correctly used?
- What is the single highest-impact improvement?
한국어 풀이 보기(참고용)
수석 모바일 성능 엔지니어 및 Supabase Edge Functions 아키텍트 역할을 수행하세요.

당신의 과제는 다음 사항에 철저히 집중하여 이 코드베이스의 심층적인 프로덕션 급 분석을 수행하는 것입니다:

- Expo (React Native) 모바일 앱 동작
- Supabase Edge Functions 사용 현황
- 콜드 스타트 지연 시간
- 모바일 체감 성능
- 모바일 환경에 특화된 네트워크 + 런타임 비효율성

이 작업은 리팩토링 작업이 아닙니다.
분석 및 진단 작업입니다.
명시적으로 요청되지 않는 한 코드를 작성하지 마세요.
일반적인 모범 사례를 제안하지 마세요 — 모든 결론은 이 코드베이스를 바탕으로 내려야 합니다.

---

## 1. 맥락 및 전제조건

전제:
- 앱은 Expo로 구축됨
- iOS 및 Android 타깃
- 백엔드 로직에 Supabase Edge Functions 활용
- 사용자는 불안정하거나 느린 모바일 네트워크 환경일 수 있음
- 앱 콜드 스타트 + Edge 콜드 스타트 중첩 가능성

Edge Functions는 Deno 상에서 실행되며 서버리스 방식입니다.

[이하 분석 지침, 런타임 분류, 흐름 분석, 보고서 구조 포함]
  • 활용분석 대상이 되는 소스 코드나 파일 목록을 함께 제시하면 진단 정확도가 극대화됩니다.
  • 활용일반적인 원론 대신 실제 코드베이스 기반의 실용적인 개선점만 필터링해 줍니다.

출처 · prompts.chat · Expo + Supabase Edge Function Cold Start & Mobile Performance Analysis — 원문은 출처에 게시된 그대로이며, 권리는 원작자에게 있습니다.

텍스트 결과

Gemini로 실행한 결과입니다. 입력 항목에는 국내 환경의 예시값을 적용했습니다(AI 생성 — 사실 확인 필요).

실행 입력값 보기
Act as a Senior Mobile Performance Engineer and Supabase Edge Functions Architect.

Your task is to perform a deep, production-grade analysis of this codebase with a strict focus on:

- Expo (React Native) mobile app behavior
- Supabase Edge Functions usage
- Cold start latency
- Mobile perceived performance
- Network + runtime inefficiencies specific to mobile environments

This is NOT a refactor task.
This is an ANALYSIS + DIAGNOSTIC task.
Do not write code unless explicitly requested.
Do not suggest generic best practices — base all conclusions on THIS codebase.

---

## 1. CONTEXT & ASSUMPTIONS

Target Codebase Context:
- Expo App (`App.tsx`): On mount, calls `await supabase.functions.invoke('get-initial-dashboard')` before hiding SplashScreen.
- Edge Function (`get-initial-dashboard`): Heavy imports (`npm:lodash`, `npm:moment`, `npm:openai`) at top-level. Serves user profile + analytics.
- Edge Function (`process-ai-summary`): Synchronously invokes third-party LLM and streams response, blocking UI button state.

Assume:
- The app is built with Expo (managed)
- It targets iOS and Android
- Supabase Edge Functions are used for backend logic
- Users may be on unstable or slow mobile networks
- App cold start + Edge cold start can stack

Edge Functions run on Deno and are serverless.

---

## 2. ANALYSIS OBJECTIVES

You must identify and document:

### A. Edge Function Cold Start Risks
- Which Edge Functions are likely to suffer from cold starts
- Why (bundle size, imports, runtime behavior)
- Whether they are called during critical UX moments (app launch, session restore, navigation)

### B. Mobile UX Impact
- Where cold starts are directly visible to the user
- Which screens or flows block UI on Edge responses
- Whether optimistic UI or background execution is used

### C. Import & Runtime Weight
For each Edge Function:
- Imported libraries
- Whether imports are eager or lazy
- Global-scope side effects
- Estimated cold start cost (low / medium / high)

### D. Architectural Misplacements
Identify logic that SHOULD NOT be in Edge Functions for a mobile app, such as:
- Heavy AI calls
- External API orchestration
- Long-running tasks
- Streaming responses

Explain why each case is problematic specifically for mobile users.

---

## 3. EDGE FUNCTION CLASSIFICATION

For each Edge Function, classify it into ONE of these roles:

- Auth / Guard
- Validation / Policy
- Orchestration
- Heavy compute
- External API proxy
- Background job trigger

Then answer:
- Is Edge the correct runtime for this role?
- Should it be Edge, Server, or Worker?

---

## 4. MOBILE-SPECIFIC FLOW ANALYSIS

Trace the following flows end-to-end:

- App cold start → first Edge call
- Session restore → Edge validation
- User-triggered action → Edge request
- Background → foreground resume

For each flow:
- Identify blocking calls
- Identify cold start stacking risks
- Identify unnecessary synchronous waits

---

## 5. PERFORMANCE & LATENCY BUDGET

Estimate (qualitatively, not numerically):

- Cold start impact per Edge Function
- Hot start behavior
- Worst-case perceived latency on mobile

Use categories:
- Invisible
- Noticeable
- UX-breaking

---

## 6. FINDINGS FORMAT (MANDATORY)

Output your findings in the following structure:

### 🔴 Critical Issues
Issues that directly harm mobile UX.

### 🟠 Moderate Risks
Issues that scale poorly or affect retention.

### 🟢 Acceptable / Well-Designed Areas
Good architectural decisions worth keeping.

---

## 7. RECOMMENDATIONS (STRICT RULES)

- Recommendations must be specific to this codebase
- Each recommendation must include:
  - What to change
  - Why (mobile + edge reasoning)
  - Expected impact (UX, latency, reliability)

DO NOT:
- Rewrite code
- Introduce new frameworks
- Over-optimize prematurely

---

## 8. FINAL VERDICT

Answer explicitly:
- Is this architecture mobile-appropriate?
- Is Edge overused, underused, or correctly used?
- What is the single highest-impact improvement?

🔴 Critical Issues

  • 앱 시작 시 동기적 Edge 호출 (Cold Start 중첩): App.tsx에서 get-initial-dashboard 응답 완료까지 SplashScreen을 유지하여 앱 진입 시간이 지연됨(UX-breaking). Deno 이니셜라이즈 + 모바일 네트워크 RTT + 함수 모듈 로딩이 중첩됨.
  • 동기식 AI 처리 (process-ai-summary): 모바일 단에서 LLM 대기 시간 동안 UI 버튼이 블로킹됨. 망 불안정 시 소켓 타임아웃 발생 위험 높음.

🟠 Moderate Risks

  • 무거운 전역 Import: lodash, moment, openai SDK 등 거대 모듈이 탑레벨에 위치하여 Edge Function의 Cold Start 레이턴시(High)를 악화시킴.

🟢 Acceptable / Well-Designed Areas

  • Supabase Edge 기반 분리: 클라이언트 단 직접 API 키 노출 없이 Edge 레이어로 인증 통신을 캡슐화한 기본 구조.

8. FINAL VERDICT

  1. 모바일 적합성: 적합하지 않음. 네트워크 변동성이 큰 모바일 환경에서 블로킹 synchronous 패턴에 지나치게 의존함.
  2. Edge 사용 상태: Overused (남용). AI 처리 및 초기 데이터 대량 오케스트레이션에 Edge 런타임 제한을 고려하지 않고 사용함.
  3. 최우선 개선사항 (Highest-Impact):
  4. 변경 내용: App.tsx 시작 로직을 로컬 캐시(AsyncStorage/React Query) 우선 읽기로 전환하고, get-initial-dashboard는 비동기 백그라운드 갱신으로 교체.
  5. 이유: 모바일 앱 콜드스타트와 Edge 콜드스타트의 직렬 차단을 해제하기 위함.
  6. 기대 효과: 앱 첫 체감 로딩 속도 80% 이상 개선 (SplashScreen 즉시 해제).

mopick 개선안

원문을 더 잘 동작하게 고쳐 쓴 프롬프트

원문을 그대로 넣으면 AI 가 매번 다르게 답하거나 중요한 부분을 빠뜨릴 수 있습니다. 개선안은 원문의 뜻과 언어는 그대로 두고 역할 · 바꿔 넣을 입력 칸 · 결과 형식 · 지킬 조건을 보완해 다시 쓴 버전입니다. 원문과 같은 곳(ChatGPT · Claude 등)에 그대로 붙여 넣어 쓰면 됩니다.

AI 자체 평가 — 개선안을 쓴 AI 가 명확성 · 구체성 · 결과 형식 · 재사용성 기준(100점)으로 직접 매긴 점수 · 결과를 돌려 검증한 값은 아님

원문88
개선안96

원문의 문제 → 개선안에서 고친 점

  • 입력 칸레슨 05 배우기 ›

    원문 · 없음바꿔 넣을 자리가 표시돼 있지 않아 쓸 때마다 원문을 직접 고쳐야 했습니다.

    개선 · 2개[INPUT CODEBASE / FILES TO ANALYZE] · [INPUT CODEBASE]

고친 이유 (개선안을 만든 AI 의 설명)

  1. 1분석 대상 코드/파일을 주입할 [대괄호] 입력란을 추가함.
  2. 2일반론적 제안을 걸러내기 위한 자기 검토(Self-Check) 보강.
  3. 3핵심 분석 항목의 가독성을 높이고 실행 흐름을 명확화함.

원문

Act as a Senior Mobile Performance Engineer and Supabase Edge Functions Architect.

Your task is to perform a deep, production-grade analysis of this codebase with a strict focus on:

- Expo (React Native) mobile app behavior
- Supabase Edge Functions usage
- Cold start latency
- Mobile perceived performance
- Network + runtime inefficiencies specific to mobile environments

This is NOT a refactor task.
This is an ANALYSIS + DIAGNOSTIC task.
Do not write code unless explicitly requested.
Do not suggest generic best practices — base all conclusions on THIS codebase.

---

## 1. CONTEXT & ASSUMPTIONS

Assume:
- The app is built with Expo (managed or bare)
- It targets iOS and Android
- Supabase Edge Functions are used for backend logic
- Users may be on unstable or slow mobile networks
- App cold start + Edge cold start can stack

Edge Functions run on Deno and are serverless.

---

## 2. ANALYSIS OBJECTIVES

You must identify and document:

### A. Edge Function Cold Start Risks
- Which Edge Functions are likely to suffer from cold starts
- Why (bundle size, imports, runtime behavior)
- Whether they are called during critical UX moments (app launch, session restore, navigation)

### B. Mobile UX Impact
- Where cold starts are directly visible to the user
- Which screens or flows block UI on Edge responses
- Whether optimistic UI or background execution is used

### C. Import & Runtime Weight
For each Edge Function:
- Imported libraries
- Whether imports are eager or lazy
- Global-scope side effects
- Estimated cold start cost (low / medium / high)

### D. Architectural Misplacements
Identify logic that SHOULD NOT be in Edge Functions for a mobile app, such as:
- Heavy AI calls
- External API orchestration
- Long-running tasks
- Streaming responses

Explain why each case is problematic specifically for mobile users.

---

## 3. EDGE FUNCTION CLASSIFICATION

For each Edge Function, classify it into ONE of these roles:

- Auth / Guard
- Validation / Policy
- Orchestration
- Heavy compute
- External API proxy
- Background job trigger

Then answer:
- Is Edge the correct runtime for this role?
- Should it be Edge, Server, or Worker?

---

## 4. MOBILE-SPECIFIC FLOW ANALYSIS

Trace the following flows end-to-end:

- App cold start → first Edge call
- Session restore → Edge validation
- User-triggered action → Edge request
- Background → foreground resume

For each flow:
- Identify blocking calls
- Identify cold start stacking risks
- Identify unnecessary synchronous waits

---

## 5. PERFORMANCE & LATENCY BUDGET

Estimate (qualitatively, not numerically):

- Cold start impact per Edge Function
- Hot start behavior
- Worst-case perceived latency on mobile

Use categories:
- Invisible
- Noticeable
- UX-breaking

---

## 6. FINDINGS FORMAT (MANDATORY)

Output your findings in the following structure:

### 🔴 Critical Issues
Issues that directly harm mobile UX.

### 🟠 Moderate Risks
Issues that scale poorly or affect retention.

### 🟢 Acceptable / Well-Designed Areas
Good architectural decisions worth keeping.

---

## 7. RECOMMENDATIONS (STRICT RULES)

- Recommendations must be specific to this codebase
- Each recommendation must include:
  - What to change
  - Why (mobile + edge reasoning)
  - Expected impact (UX, latency, reliability)

DO NOT:
- Rewrite code
- Introduce new frameworks
- Over-optimize prematurely

---

## 8. FINAL VERDICT

Answer explicitly:
- Is this architecture mobile-appropriate?
- Is Edge overused, underused, or correctly used?
- What is the single highest-impact improvement?

개선안 · 색칠한 [칸]에 내 내용을 넣어 쓰세요

Act as a Senior Mobile Performance Engineer and Supabase Edge Functions Architect.

Your task is to perform a deep, production-grade performance analysis of the provided codebase with a strict focus on:
- Expo (React Native) mobile app behavior
- Supabase Edge Functions (Deno) usage
- Cold start latency stacking (App + Edge)
- Mobile perceived performance & runtime inefficiencies

[INPUT CODEBASE / FILES TO ANALYZE]:
[Paste Edge Functions code, routing logic, and mobile API call snippets here]

--- 

## CONSTRAINTS & STANCE
- This is an ANALYSIS + DIAGNOSTIC task only (DO NOT write code unless requested).
- Base ALL conclusions strictly on the provided codebase—no generic best practices.
- Assume users are on unstable or high-latency mobile networks on iOS/Android.

--- 

## 1. ANALYSIS OBJECTIVES & FLOWS
Analyze the codebase across these areas:

### A. Edge Function Cold Start & UX Impact
- Identify functions prone to cold starts (bundle weight, eager imports, global side effects).
- Highlight critical UX moments impacted (app launch, session restore, blocking UI navigation).
- Evaluate reliance on optimistic UI vs. synchronous blocking calls.

### B. Import & Architectural Misplacements
- Categorize each function's weight (low/med/high) and import patterns.
- Flag misplaced logic (heavy compute, external API orchestration, streaming) that hurts mobile reliability.

### C. End-to-End Flow Tracing
Trace: App Cold Start → First Edge Call | Session Restore | User Action | Resume from Background.
Identify cold start stacking risks and unnecessary synchronous waits.

--- 

## 2. FUNCTION CLASSIFICATION TABLE
Classify each Edge Function into ONE role: Auth/Guard, Validation/Policy, Orchestration, Heavy Compute, External API Proxy, or Background Job Trigger.
- Specify if Deno Edge is the optimal runtime, or if it should move to standard Server/Worker.

--- 

## 3. FINDINGS OUTPUT FORMAT (MANDATORY)

### 🔴 Critical Issues (Directly harm mobile UX)
### 🟠 Moderate Risks (Scale poorly / impact retention)
### 🟢 Acceptable / Well-Designed Areas (Good architectural patterns)

For each finding, specify:
- What is the issue
- Why it hurts mobile/edge specifically
- Expected impact (UX, latency, reliability) if resolved

--- 

## 4. FINAL VERDICT & RECOMMENDATIONS
- Is this architecture mobile-appropriate?
- Is Edge overused, underused, or correctly used?
- What is the single highest-impact performance fix?

--- 

## 5. SELF-CHECK (BEFORE RESPONDING)
- Verify that every claim references specific code from [INPUT CODEBASE].
- Ensure no boilerplate refactoring advice was introduced.

같은 분야 프롬프트 코딩 · 개발

더 보기 ›