Skip to main content

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.

Learning Focus

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.

~/.config/kitty/kitty.conf
# On: smoother scrolling, less tearing
# Off: lower latency, higher frame rate
sync_to_busy yes
ValueEffectUse Case
yes (default)Syncs to output rateGeneral use, smooth scrolling
noAlways renders at max fpsLow-latency needs, real-time output

repaint_delay

Minimum delay between screen repaints (in milliseconds).

~/.config/kitty/kitty.conf
# Lower = smoother animation, more CPU/GPU usage
# Higher = less power consumption, slightly laggy feel
repaint_delay 10
Valuefps capUse Case
5~200 fpsHiDPI, gaming, animation-heavy workflows
10~100 fpsGeneral use (default)
16~60 fpsBattery saving, lower-end GPUs
20~50 fpsPassive monitoring, remote sessions

repaint_defer_delay

How long kitty waits after input before repainting (in milliseconds).

~/.config/kitty/kitty.conf
# 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).

~/.config/kitty/kitty.conf
# 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.

~/.config/kitty/kitty.conf
# 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

FeaturePerformance costVisual benefit
LigaturesMedium (glyph shaping)Programming glyphs (=>, !=, ->)
Italic fontsLowReadability in prose
Bold fontsLowVisual hierarchy
Emoji renderingHigh (color bitmap)Visual indicators
Fallback fontsMedium (atlas rebuild)Unicode coverage

Scrollback Memory Usage

Kitty stores scrollback in memory. Large scrollback buffers consume significant RAM.

~/.config/kitty/kitty.conf
# 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_linesApproximate RAMUse Case
1000~200 KBMinimal, embedded systems
10000~2 MBGeneral use
100000~20 MBLog analysis, heavy scrolling
1000000~200 MBDebugging massive output

Reducing Latency

For real-time applications (live log tailing, monitoring dashboards):

~/.config/kitty/kitty.conf
# 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:

~/.config/kitty/kitty.conf
# 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

CheckCommandExpected
GPU accelerationkitty --debug-rendering"Using OpenGL renderer"
OpenGL versionkitty --debug-rendering | grep "OpenGL version">= 3.3
VSynckitty --debug-rendering | grep VSync"on" (if smooth)
GPU modelglxinfo -B | grep "Device:"Your GPU
Benchmarkkitty +kitten benchmarkCompare with CPU mode
Font atlaskitty --debug-fontsNo "fallback" warnings
Config errorskitty --debug-configNo errors
Scrollback RAMCheck htop RES column for kitty~2-20 MB typical

Common Pitfalls

PitfallSymptomFix
GPU acceleration disabledPoor scrolling performanceCheck KITTY_DISABLE_OPENGL env var is not set
Wayland without GLCrash on launchSet KITTY_DISABLE_WAYLAND=1
Too low repaint_delayHigh CPU usage alwaysRaise to 12-16 for battery savings
Huge scrollback_linesKitty using >500 MB RAMReduce scrollback_lines to 10000
Complex font ligaturesLag when typingSet disable_ligatures always
Running in VM without GPUSoftware 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}'

What's Next