performance-optimization
Fungsinya
Skill ini memandu pencarian masalah performa dalam game dengan metode yang mengukur terlebih dahulu. Skill ini ditujukan untuk pengembang yang game-nya kehilangan frame, tersendat, atau tidak mencapai target kecepatan.
Kapan dipakai
- βSaat frame rate game Anda turun atau tersendat selama bermain.
- βSaat Anda perlu mencapai target frame rate di desktop atau seluler.
- βSaat Anda perlu memutuskan apakah CPU atau GPU yang menjadi hambatan sebelum mengubah kode.
Link skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/disciplines/performance-optimization/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βGame saya tersendat setiap beberapa detik di seluler. Bisakah Anda membantu mencari tahu apa yang lambat dan memperbaikinya?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent melakukan profiling pada game terlebih dahulu, membaca anggaran waktu frame, dan memeriksa apakah CPU atau GPU yang membatasi. Setelah itu agent menerapkan perbaikan yang tepat seperti object pooling, panggilan draw yang lebih sedikit, alokasi memori yang lebih sedikit, atau anggaran aset, lalu mengukur ulang.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Performance optimization
Performance work is a measurement discipline, not a bag of tricks. The method is always the
same: profile β find the one bottleneck β fix that β measure again. This skill teaches that
loop and the highest-leverage fixes (pooling, batching, allocation control, asset budgets), and
points you at each engine's profiler. It pairs with physics-tuning for simulation cost.
When to use
- Use when the frame rate is low or uneven, the game stutters/hitches, or it must hit a target (60 FPS desktop, 30/60 mobile) and currently doesn't.
- Use to decide what to optimize: profile, read the frame budget, and identify whether the CPU or GPU is the bottleneck before changing any code.
- Use to apply specific fixes: object pooling, draw-call/batch reduction, removing per-frame allocations and GC spikes, and setting asset budgets.
When not to use: for physics jitter/tunneling/timestep specifically, use physics-tuning.
For the engine's concrete profiler UI and rendering settings, use that
engine skill (godot-export covers some build settings; engine cores cover the rest). This skill
is the cross-engine method and the shared fixes.
The golden rule: measure first, never guess
Most performance "fixes" applied without profiling target the wrong thing and add complexity for no gain. Do not optimize code you have not measured. Open the profiler, find the single biggest cost in a representative scene on representative hardware, and fix that. Re-measure to confirm the fix helped before moving on. Profile a release/optimized build where it matters β editor and debug builds lie (editor overhead, no compiler optimization).
Core workflow
- Define the target and reproduce. State the goal (e.g. 60 FPS = 16.67 ms/frame) and find a repeatable worst-case scene. "Sometimes slow" is unfixable; a reproducible spike is fixable.
- Profile before touching code. Run the engine profiler and read the frame: total frame time, and the split between CPU (game logic, physics, scripts) and GPU (rendering).
- Find the bottleneck β CPU or GPU. If GPU time β« CPU, attack draw calls/overdraw/shaders/ resolution. If CPU time dominates, attack scripts/physics/allocations. Fixing the wrong side does nothing.
- Fix the single biggest cost. Prefer an algorithmic win (do less work, cache, spatial partition, run less often) over micro-optimizing a hot line. Apply the matching shared fix (pooling, batching, allocation removal).
- Re-measure on the same scene/hardware. Confirm the number moved. Keep or revert based on data, not intuition.
- Set budgets so it stays fixed. Per-frame ms budgets per subsystem, plus asset budgets (texture sizes, triangle counts, draw-call ceilings); add a perf check to verification.
- Report measured numbers. State before/after frame time, the bottleneck found, and the fix β never "should be faster". If you could only measure in-editor, say so.
Patterns
1. Frame budget math (turn "feels slow" into a number)
target FPS β frame budget: 60 FPS = 16.67 ms | 30 FPS = 33.3 ms | 120 FPS = 8.33 ms
The WHOLE frame (CPU sim + render submit + GPU) must fit the budget; the GPU runs in parallel,
so the slower of CPU-frame and GPU-frame sets your FPS. Allocate sub-budgets, e.g. @60 FPS:
gameplay/scripts ~5 ms Β· physics ~3 ms Β· rendering(CPU submit) ~4 ms Β· UI/other ~2 ms Β· slack.
If one subsystem blows its slice, that's your target β not whatever you assumed.
2. Measure with the engine profiler (do this before any fix)
Godot 4.7 : Debugger βΈ Profiler (script/physics time), Visual Profiler (CPU vs GPU render time
per pass) and Monitors tab (FPS, draw calls, memory).
In code: Performance.get_monitor(Performance.TIME_PROCESS) returns SECONDS
(Γ 1000 for ms); Performance.RENDER_TOTAL_DRAW_CALLS_IN_FRAME for draw calls.
Unity 6.3 LTS : Profiler window (CPU/GPU/Memory/Rendering modules) + Frame Debugger for draw calls.
In code: ProfilerRecorder on "CPU Main Thread Frame Time" / "GPU Frame Time"
(release players need Frame Timing Stats enabled in Player Settings).
Unreal 5.8 : `stat unit` (Frame / Game / Draw / RHIT / GPU ms), `stat fps`,
`stat scenerendering` (draw calls); Unreal Insights for deep traces.
# Read the split: Game = gameplay thread, Draw = render thread (both CPU), GPU = t
Pertanyaan umum
Haruskah saya mengoptimalkan kode yang belum diukur?
Tidak. Skill menyebutkan bahwa sebagian besar perbaikan tebakan menargetkan hal yang salah dan menambah kerumitan tanpa keuntungan.
Apakah ia mencakup masalah fisika?
Jitter dan tunneling fisika ditangani oleh skill penyetelan fisika.
Profiler apa yang dipakai?
Skill menyebutkan untuk memakai profiler bawaan engine Anda.
Detail
Deskripsi asli dari pembuat
Find and fix game performance problems methodically β measure with the engine profiler first, reason about the frame-time budget, locate the CPU-vs-GPU bottleneck, then apply the right fix: object pooling, draw-call batching, fewer allocations/GC spikes, and asset budgets. Engine- neutral method that pairs with each engine's profiler. Use when the user mentions performance, optimize, low/dropping FPS, frame drops, stutter, lag, profiler, frame budget, draw calls, batching, garbage collection/GC spikes, object pooling, or "the game runs slow".
Popularitas
- Bintang GitHub
- 6.6k
- Peringkat
- #13801
- Lisensi
- Apache-2.0
- Diperbarui
- 28/10/2026
Komentar
- β¦
Skill lain dari repositori ini
router
6.6kMembantu agent Anda memilih skill pengembangan game yang tepat untuk setiap permintaan dengan mendeteksi engine Anda dan jenis tugas yang Anda perlukan.
ai-behavior-trees-utility-ai
6.6kMembantu agent Anda membangun behavior tree dan sistem utility AI untuk musuh dan karakter game yang memilih aksi berdasarkan prioritas dan skor.
audio-design
6.6kMengajari agent Anda cara mixing audio game: bus, volume dalam desibel, ducking di bawah dialog, musik adaptif, dan variasi efek suara.
camera-systems
6.6kMembantu agent Anda membangun kamera game yang mengikuti dengan halus, tetap berada di dalam level, dan dapat mengorbit atau melihat sekeliling dalam 3D.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.