Performance optimization for Google Antigravity IDE
# Web Performance Guide for Google Antigravity
Master web performance in Google Antigravity IDE.
## Image Optimization
```typescript
import Image from "next/image";
export function OptimizedImage({ src, alt }: { src: string; alt: string }) {
return (
<Image
src={src}
alt={alt}
width={800}
height={600}
loading="lazy"
placeholder="blur"
sizes="(max-width: 768px) 100vw, 50vw"
/>
);
}
export function HeroImage({ src, alt }: { src: string; alt: string }) {
return <Image src={src} alt={alt} fill priority sizes="100vw" />;
}
```
## Code Splitting
```typescript
import dynamic from "next/dynamic";
const HeavyChart = dynamic(() => import("./HeavyChart"), {
loading: () => <ChartSkeleton />,
ssr: false
});
export function Dashboard() {
return (
<Suspense fallback={<ChartSkeleton />}>
<HeavyChart />
</Suspense>
);
}
```
## Resource Hints
```typescript
export default function RootLayout({ children }) {
return (
<html>
<head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="dns-prefetch" href="https://api.example.com" />
</head>
<body>{children}</body>
</html>
);
}
```
## Best Practices
1. **Lazy load below fold** - Defer non-critical content
2. **Optimize images** - Use next/image
Google Antigravity IDE provides performance scaffolding.This Performance prompt is ideal for developers working on:
By using this prompt, you can save hours of manual coding and ensure best practices are followed from the start. It's particularly valuable for teams looking to maintain consistency across their performance implementations.
Yes! All prompts on Antigravity AI Directory are free to use for both personal and commercial projects. No attribution required, though it's always appreciated.
This prompt works excellently with Claude, ChatGPT, Cursor, GitHub Copilot, and other modern AI coding assistants. For best results, use models with large context windows.
You can modify the prompt by adding specific requirements, constraints, or preferences. For Performance projects, consider mentioning your framework version, coding style, and any specific libraries you're using.