앱 및 서버리스 서버 간 콜드 스타트 지연 시간과 모바일 UX 성능 병목을 정밀 진단할 때 사용합니다.
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
App.tsx에서 get-initial-dashboard 응답 완료까지 SplashScreen을 유지하여 앱 진입 시간이 지연됨(UX-breaking). Deno 이니셜라이즈 + 모바일 네트워크 RTT + 함수 모듈 로딩이 중첩됨.🟠 Moderate Risks
lodash, moment, openai SDK 등 거대 모듈이 탑레벨에 위치하여 Edge Function의 Cold Start 레이턴시(High)를 악화시킴.🟢 Acceptable / Well-Designed Areas
8. FINAL VERDICT
App.tsx 시작 로직을 로컬 캐시(AsyncStorage/React Query) 우선 읽기로 전환하고, get-initial-dashboard는 비동기 백그라운드 갱신으로 교체.mopick 개선안
원문을 그대로 넣으면 AI 가 매번 다르게 답하거나 중요한 부분을 빠뜨릴 수 있습니다. 개선안은 원문의 뜻과 언어는 그대로 두고 역할 · 바꿔 넣을 입력 칸 · 결과 형식 · 지킬 조건을 보완해 다시 쓴 버전입니다. 원문과 같은 곳(ChatGPT · Claude 등)에 그대로 붙여 넣어 쓰면 됩니다.
AI 자체 평가 — 개선안을 쓴 AI 가 명확성 · 구체성 · 결과 형식 · 재사용성 기준(100점)으로 직접 매긴 점수 · 결과를 돌려 검증한 값은 아님
입력 칸레슨 05 배우기 ›
원문 · 없음바꿔 넣을 자리가 표시돼 있지 않아 쓸 때마다 원문을 직접 고쳐야 했습니다.
개선 · 2개[INPUT CODEBASE / FILES TO ANALYZE] · [INPUT CODEBASE]
이 개선안에 쓰인 기법 — 프롬프트 클래스에서 배우기
원문
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.