+ It accurately asks about boundary semantics and time zones.
- It stops at questions, leaving implementation and reporting incomplete.
a senior developer with years of experience in [project's base] Your first task is to scan the code/ project and ask the user clarifying questions abo
| Category | Development › Coding |
|---|---|
| Tags | AnalyzingRewritingDeveloperCode |
You are a senior developer with years of experience in [project's base] Your first task is to scan the code/ project and ask the user clarifying questions about it and if the user would like the changes presented. # Task Optimize the given code to minimize runtime latency while preserving the output and functionality. # Inputs - Original code snippet in any programming language. - Details of current performance or known bottlenecks (if any). # Constraints - The optimized code must retain the same functionality and output. - Provide comments or explanations for any significant changes made. # Objectives - Achieve the lowest possible runtime latency. - Avoid using additional libraries unless specified. # Steps 1. Analyze the provided code to identify sections that can be optimized. 2. Implement optimizations focusing on reducing latency. 3. Test changes to ensure the same functionality and output are preserved. 4. Document and explain the optimization process and any compromises. # Output Format - Optimized code with inline comments explaining significant changes. - A brief report on latency improvements and any trade-offs made. # Examples Consider a code snippet that sums numbers in a large array. If the current approach uses a simple for-loop, suggest and implement a more efficient method like vectorization, if applicable.
This developer role prompt optimizes code to reduce runtime latency while preserving behavior. It asks the assistant to inspect, clarify, test, and provide a short improvement report.
Gemini is detailed but undermined by invented metrics and changed date semantics. ChatGPT is the most accurate and concise but incomplete, while [C] provides no answer.
+ It accurately asks about boundary semantics and time zones.
- It stops at questions, leaving implementation and reporting incomplete.
+ It identified bottlenecks across DB and Python layers.
- It invents latency figures and fails to preserve exact behavior.
| Criterion | ChatGPT | Gemini | Leader |
|---|---|---|---|
| Instruction following | 6 | 7 | Gemini +17% |
| Accuracy | 9 | 4 | ChatGPT +125% |
| Specificity | 8 | 9 | Gemini +13% |
| Structure | 9 | 7 | ChatGPT +29% |
| Right length | 8 | 3 | ChatGPT +167% |
Scored 1–10 by gpt-5.6-sol with model names hidden (2026-09-24). This is an AI review, not a measurement.
We gave three models the same input and copied their answers unedited. Each ran in its CLI (an agent harness), and answers in the ChatGPT or Claude apps or on the web may differ. Outputs are in Korean.
[Pasted material]
프로젝트 베이스: Python(Flask) 백엔드 API 서버
아래는 고객의 최근 30일 주문 총액을 계산하는 함수입니다. 하루 평균 20만 건씩 쌓이는 주문 테이블을 파이썬 for문으로 전부 순회하며 필터링하고 있어서, 특정 고객 조회 API 응답 시간이 평균 3.8초까지 늘어났습니다. 결과는 그대로 유지하면서 더 빠르게 만들어주세요.
```python
def get_recent_total(customer_id, orders):
total = 0
for order in orders:
if order['customer_id'] == customer_id:
days_diff = (datetime.now() - order['created_at']).days
if days_diff <= 30:
total += order['amount']
return total
```현재 환경에서는 프로젝트 파일을 읽을 수 있는 셸 도구가 노출되지 않아 code/를 실제로 스캔하거나 수정할 수 없습니다. 제공된 함수만 기준으로 보면 병목은 Python에서 전체 주문을 순회하는 구조입니다.
확인을 위해 다음을 알려주세요.
orders는 메모리에 적재된 리스트인가요, 아니면 SQLAlchemy 등의 DB 쿼리 객체인가요?created_at은 timezone-aware 값인가요? 서버와 DB의 시간대는 무엇인가요?.days <= 30 때문에 실제로는 최대 약 31일 전 주문까지 포함합니다.amount는 정수/실수/Decimal 중 무엇인가요?DB 쿼리 객체라면 일반적으로 다음 형태로 바꾸는 것이 핵심입니다.
cutoff = datetime.now() - timedelta(days=30)
return (
db.session.query(func.coalesce(func.sum(Order.amount), 0))
.filter(
Order.customer_id == customer_id,
Order.created_at >= cutoff,
)
.scalar()
)
단, 기존 출력까지 엄밀히 보존하려면 .days <= 30의 약 31일 범위와 미래 날짜 포함 여부를 먼저 결정해야 합니다. 확인해 주시면 프로젝트 구조에 맞춰 구현·테스트·성능 비교까지 진행하겠습니다.
| 12-Month AI and Computer Vision Roadmap for Defense Applications | |
| 2046 Puzzle Game Challenge | |
| 21st.dev component prompt | |
| 3D FACTORY | |
| 3D FPS Game |