Performance Tuning
Kitty is built for performance, but the default settings may not be optimal for your hardware or workflow. This lesson covers tuning GPU rendering, latency, memory, and font performance.
Understand kitty's rendering pipeline so you can tune it for your specific GPU, display, and workload.
GPU vs CPU Rendering
Kitty uses OpenGL 3.3+ for hardware-accelerated rendering. When the GPU pipeline is healthy, kitty can sustain 240+ fps on scrollback and rapid output.
Kitty Rendering Pipeline:
Application output
│
▼
PTY (pseudo-terminal)
│
▼
Kitty Server
├─ Parse output into cells
├─ Build texture atlas (GPU upload)
└─ Issue OpenGL draw calls
│
▼
GPU Pipeline:
┌─────────────────────────────┐
│ Vertex Shader │
│ → Position glyph quads │
├─────────────────────────────┤
│ Fragment Shader │
│ → Sample glyph atlas │
│ → Apply colors/effects │
├─────────────────────────────┤
│ Compositing │
│ → Final framebuffer │
└─────────────────────────────┘
│
▼
Display
When GPU is unavailable or fails, kitty falls back to CPU rendering (significantly slower).
Checking GPU Acceleration
# Test if GPU acceleration is working
kitty --debug-rendering 2>&1
# Look for:
# "Using OpenGL renderer: NVIDIA Corporation / GeForce RTX 3060"
# "VSync: on"
# Quick benchmark
kitty +kitten benchmark
# Compare with CPU-only mode
KITTY_DISABLE_OPENGL=1 kitty +kitten benchmark
Expected output from kitty --debug-rendering:
[debug] Using OpenGL renderer: <vendor> / <GPU model>
[debug] OpenGL version: 4.6
[debug] Texture atlas size: 2048x2048
[debug] VSync: on
[debug] Synchronous rendering mode: off
Key Performance Settings
sync_to_busy
Controls whether kitty synchronizes rendering with the application's output rate.
# On: smoother scrolling, less tearing
# Off: lower latency, higher frame rate
sync_to_busy yes
| Value | Effect | Use Case |
|---|---|---|
yes (default) | Syncs to output rate | General use, smooth scrolling |
no | Always renders at max fps | Low-latency needs, real-time output |
repaint_delay
Minimum delay between screen repaints (in milliseconds).
# Lower = smoother animation, more CPU/GPU usage
# Higher = less power consumption, slightly laggy feel
repaint_delay 10
| Value | fps cap | Use Case |
|---|---|---|
| 5 | ~200 fps | HiDPI, gaming, animation-heavy workflows |
| 10 | ~100 fps | General use (default) |
| 16 | ~60 fps | Battery saving, lower-end GPUs |
| 20 | ~50 fps | Passive monitoring, remote sessions |
repaint_defer_delay
How long kitty waits after input before repainting (in milliseconds).
# Lower = more responsive to keystrokes
# Higher = batches more input before redraw (efficient)
repaint_defer_delay 5
input_delay
Minimum delay between processing input events (in milliseconds).
# Lower = input feels more responsive
# Higher = fewer CPU wakeups, better battery
input_delay 3
Font Rendering Performance
Font rendering is the most CPU-intensive part of terminal display. Kitty uses a texture atlas to cache glyphs on the GPU.
# Disable ligatures for performance (ligature shaping is expensive)
disable_ligatures always
# Limit font features to reduce atlas rebuilds
font_features FiraCode +zero +cv01
# Use a simple monospace font (less complex shaping)
font_family monospace
Performance Impact of Font Features
| Feature | Performance cost | Visual benefit |
|---|---|---|
| Ligatures | Medium (glyph shaping) | Programming glyphs (=>, !=, ->) |
| Italic fonts | Low | Readability in prose |
| Bold fonts | Low | Visual hierarchy |
| Emoji rendering | High (color bitmap) | Visual indicators |
| Fallback fonts | Medium (atlas rebuild) | Unicode coverage |
Scrollback Memory Usage
Kitty stores scrollback in memory. Large scrollback buffers consume significant RAM.
# Reduce scrollback to save memory
scrollback_lines 2000
# Or increase for heavy log analysis
# scrollback_lines 100000
# Show scrollback indicator
scrollback_indicator_opacity 0.5
Estimated memory per scrollback line: ~200 bytes (with color and styling).
scrollback_lines | Approximate RAM | Use Case |
|---|---|---|
| 1000 | ~200 KB | Minimal, embedded systems |
| 10000 | ~2 MB | General use |
| 100000 | ~20 MB | Log analysis, heavy scrolling |
| 1000000 | ~200 MB | Debugging massive output |
Reducing Latency
For real-time applications (live log tailing, monitoring dashboards):
# Low-latency config
sync_to_busy no
repaint_delay 5
repaint_defer_delay 3
input_delay 1
cursor_interval 500
For battery life on laptops:
# Power-saving config
sync_to_busy yes
repaint_delay 20
repaint_defer_delay 15
input_delay 10
cursor_interval 1000
mouse_hide_wait 5.0
Benchmarking
# Run the built-in benchmark
kitty +kitten benchmark
# To compare with other terminals:
# Open a new terminal and run:
# hyperfine "seq 1 100000 | pv -qL 50000 > /dev/null"
# Test redraw latency:
# Run this inside kitty and observe smoothness:
for i in $(seq 1 100); do clear; seq 1 $(tput lines) | column; sleep 0.05; done
Performance Tuning Checklist
| Check | Command | Expected |
|---|---|---|
| GPU acceleration | kitty --debug-rendering | "Using OpenGL renderer" |
| OpenGL version | kitty --debug-rendering | grep "OpenGL version" | >= 3.3 |
| VSync | kitty --debug-rendering | grep VSync | "on" (if smooth) |
| GPU model | glxinfo -B | grep "Device:" | Your GPU |
| Benchmark | kitty +kitten benchmark | Compare with CPU mode |
| Font atlas | kitty --debug-fonts | No "fallback" warnings |
| Config errors | kitty --debug-config | No errors |
| Scrollback RAM | Check htop RES column for kitty | ~2-20 MB typical |
Common Pitfalls
| Pitfall | Symptom | Fix |
|---|---|---|
| GPU acceleration disabled | Poor scrolling performance | Check KITTY_DISABLE_OPENGL env var is not set |
| Wayland without GL | Crash on launch | Set KITTY_DISABLE_WAYLAND=1 |
| Too low repaint_delay | High CPU usage always | Raise to 12-16 for battery savings |
| Huge scrollback_lines | Kitty using >500 MB RAM | Reduce scrollback_lines to 10000 |
| Complex font ligatures | Lag when typing | Set disable_ligatures always |
| Running in VM without GPU | Software rendering (slow) | Lower repaint_delay to 16, keep sync_to_busy yes |
Hands-On Practice
# 1. Check your GPU rendering status
kitty --debug-rendering 2>&1
# 2. Run benchmark in normal mode
kitty +kitten benchmark
# 3. Run benchmark in CPU-only mode (for comparison)
KITTY_DISABLE_OPENGL=1 kitty +kitten benchmark
# 4. Profile current performance settings
grep -E "^(sync_to_busy|repaint_delay|repaint_defer_delay|input_delay)" ~/.config/kitty/kitty.conf
# 5. Test latency difference:
# Open two kitty windows side by side
# One with default settings, one with low-latency config
# Run: while true; do date; sleep 0.1; done
# Observe the responsiveness difference
# 6. Check memory usage
ps -o rss,pid,command -p $(pgrep kitty) | awk 'NR>1 {printf "Kitty PID %d: %.1f MB RSS\n", $2, $1/1024}'