Google Antigravity Performance Optimization: Speed Up Your Development & Code
Google Antigravity Performance Optimization: Speed Up Your Development & Code
Performance matters—both for your IDE experience and the code you ship. This guide covers optimizing Google Antigravity itself and using Gemini 3 to write faster code.
IDE Performance
Optimize Antigravity Settings
// settings.json optimizations
{
// Reduce file watching
"files.watcherExclude": {
"**/node_modules/**": true,
"**/dist/**": true,
"**/.git/**": true,
"**/coverage/**": true
},
// Limit search scope
"search.exclude": {
"**/node_modules": true,
"**/dist": true,
"**/*.min.js": true
},
// Optimize editor
"editor.minimap.enabled": false,
"editor.renderWhitespace": "selection",
"editor.cursorBlinking": "solid",
// Optimize Gemini
"antigravity.gemini.debounceMs": 300,
"antigravity.gemini.maxContextTokens": 50000
}
Extension Performance
Check slow extensions:
- Open Command Palette
- Run "Developer: Show Running Extensions"
- Disable heavy extensions not in use
Memory Management
{
// Limit memory usage
"antigravity.maxMemory": 4096,
// Close unused tabs
"workbench.editor.limit.enabled": true,
"workbench.editor.limit.value": 10
}
Code Performance Analysis
Request Performance Review
You: "Analyze this code for performance issues"
// Before: N+1 query problem
async function getOrdersWithProducts(userId: string) {
const orders = await db.orders.findMany({ userId });
for (const order of orders) {
order.products = await db.products.findMany({
where: { orderId: order.id }
});
}
return orders;
}
Gemini 3 identifies:
## Performance Issues Found
1. **N+1 Query Problem** (Critical)
- 1 query for orders + N queries for products
- 100 orders = 101 database queries
2. **Solution: Use includes/joins**
\`\`\`typescript
async function getOrdersWithProducts(userId: string) {
return db.orders.findMany({
where: { userId },
include: { products: true }
});
}
\`\`\`
3. **Result: 1 query total**