Why Monolex is Fast
Monolex is built differently from other terminals. Here’s why it feels so much faster.Copy
╔═══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ MONOLEX PERFORMANCE ║
║ ║
║ Traditional Terminal Monolex ║
║ ──────────────────── ─────── ║
║ ║
║ CPU Usage: ████████████ CPU Usage: ██ ║
║ (High) (Low) ║
║ ║
║ Data Transfer: 100% Data Transfer: ~5% ║
║ ║
║ Screen Updates: 100/sec Screen Updates: 5-10/sec ║
║ ║
╚═══════════════════════════════════════════════════════════════════════════════╝
The Three Pillars of Speed
Copy
┌─────────────────────────────────────────────────────────────────┐
│ │
│ THREE PILLARS OF SPEED │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ │ │ │ │ │ │
│ │ NATIVE │ │ SMART │ │ DIRECT │ │
│ │ SPEED │ │ UPDATES │ │ DISPLAY │ │
│ │ │ │ │ │ │ │
│ │ (Rust) │ │ (Diff) │ │ (Injection) │ │
│ │ │ │ │ │ │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ └─────────────────┼─────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ FAST, SMOOTH │ │
│ │ TERMINAL │ │
│ └─────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Pillar 1: Native Speed (Alacritty VTE Parser)
Most terminals use JavaScript to understand terminal commands. Monolex uses the Alacritty VTE Parser - the same battle-tested Rust parser used by the popular Alacritty terminal.Copy
┌─────────────────────────────────────────────────────────────────┐
│ SPEED COMPARISON: Processing Terminal Commands │
├─────────────────────────────────────────────────────────────────┤
│ │
│ JavaScript (Other Terminals): │
│ ─────────────────────────────── │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│ │
│ └──────────────────────────────────────────────────────────┘ │
│ Takes longer, uses more energy │
│ │
│ Rust (Monolex): │
│ ─────────────────────────────── │
│ ┌──────────┐ │
│ │██████████│ │
│ └──────────┘ │
│ Much faster, uses less energy │
│ │
│ │
│ Why Rust is faster: │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ JavaScript │ Rust │ │
│ │ ───────────────── │ ────── │ │
│ │ Needs translator │ Runs directly │ │
│ │ (interpreter) │ on your CPU │ │
│ │ │ │ │
│ │ Like reading │ Like understanding │ │
│ │ through a │ the language │ │
│ │ translator │ natively │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Think of it this way: JavaScript is like giving directions through a translator. Rust is like speaking the computer’s native language directly.
Pillar 2: Smart Updates
Monolex only sends what changed, not the entire screen:Copy
┌─────────────────────────────────────────────────────────────────┐
│ SMART UPDATE SYSTEM │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Traditional: Send EVERYTHING every time │
│ ─────────────────────────────────────── │
│ │
│ Screen (40 rows): │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Row 1: Hello World SEND ✓ │ │
│ │ Row 2: This is a test SEND ✓ │ │
│ │ Row 3: ... SEND ✓ │ │
│ │ Row 4: ... SEND ✓ │ │
│ │ ... │ │
│ │ Row 39: ... SEND ✓ │ │
│ │ Row 40: cursor here_ SEND ✓ │ │
│ └──────────────────────────────────────────────────────────┘ │
│ = 40 rows sent = ~50 KB │
│ │
│ │
│ Monolex: Send ONLY what changed │
│ ─────────────────────────────────────── │
│ │
│ Screen (40 rows): │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Row 1: Hello World skip │ │
│ │ Row 2: This is a test skip │ │
│ │ Row 3: ... skip │ │
│ │ Row 4: ... skip │ │
│ │ ... │ │
│ │ Row 39: ... skip │ │
│ │ Row 40: cursor here_ ← CHANGED! SEND ✓ │ │
│ └──────────────────────────────────────────────────────────┘ │
│ = 1 row sent = ~0.5 KB │
│ │
└─────────────────────────────────────────────────────────────────┘
Data Reduction Visualization (Stage 2: True Partial Mode)
Copy
┌─────────────────────────────────────────────────────────────────┐
│ DATA SENT PER UPDATE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Traditional (Full Screen): │
│ ████████████████████████████████████████████████████ 50 KB │
│ │
│ Monolex (typing - only changed row): │
│ █ 0.5 KB │
│ │
│ ← 99.95% less data transferred! │
│ │
│ │
│ Four Smart Modes: │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ FULL - Entire screen (when needed) 100% │ │
│ │ PARTIAL - Only changed lines 1-5% │ │
│ │ NONE - Just cursor position ~0% │ │
│ │ SKIP - Invalid frame (discard) 0% │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
│ What this means for you: │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Less data → Less work → Less heat → More battery │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Automatic Mode Selection (The 50% Rule)
Monolex automatically picks the fastest method based on how much changed:Copy
┌─────────────────────────────────────────────────────────────────┐
│ THE 50% RULE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Changed Lines Best Mode Why? │
│ ───────────── ───────── ──────────────────────────── │
│ │
│ 1-20 rows PARTIAL Sending individual lines is │
│ cheaper than full screen │
│ │
│ 21+ rows FULL Sending full screen becomes │
│ (>50%) more efficient than many lines │
│ │
│ ───────────────────────────────────────────────────────────── │
│ │
│ Example (40-row screen): │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ PARTIAL: Send 5 lines = 5 × 1.2KB = ~6KB │ │
│ │ FULL: Send screen = 1 × 50KB = 50KB │ │
│ │ → PARTIAL wins! (90% less data) │ │
│ │ │ │
│ │ PARTIAL: Send 25 lines = 25 × 1.2KB = ~30KB │ │
│ │ FULL: Send screen = 1 × 50KB = 50KB │ │
│ │ → FULL wins! (simpler, fewer operations) │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
│ Monolex picks the fastest method automatically! │
│ │
└─────────────────────────────────────────────────────────────────┘
When you run commands like
clear or scroll through long output, Monolex switches to FULL mode automatically. For normal typing and editing, it uses PARTIAL mode. You don’t need to configure anything.How It Works: Hash-Based Diffing
Instead of comparing every character, Monolex uses fingerprints (hashes) to instantly detect changes:Copy
┌─────────────────────────────────────────────────────────────────┐
│ HASH-BASED LINE COMPARISON │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Each line gets a "fingerprint" (hash): │
│ │
│ Line 1: "Hello World" → Hash: 0xA3F2B71C │
│ Line 2: "$ ls -la" → Hash: 0x8C4D91E5 │
│ Line 3: "file.txt" → Hash: 0x2B7A03F9 │
│ │
│ ───────────────────────────────────────────────────────────── │
│ │
│ Comparing lines = Comparing fingerprints (instant!) │
│ │
│ Old Hash New Hash Result │
│ ──────── ──────── ────── │
│ 0xA3F2B71C == 0xA3F2B71C SAME → skip! │
│ 0x8C4D91E5 == 0x8C4D91E5 SAME → skip! │
│ 0x2B7A03F9 != 0x5E1C82A4 DIFFERENT → send! │
│ │
│ Only send lines where fingerprint changed! │
│ │
└─────────────────────────────────────────────────────────────────┘
Why is this faster? Traditional terminals compare 4,800+ characters per frame. Monolex compares just 40 fingerprints - 120× faster comparison.
Real-World Examples
Copy
╔═══════════════════════════════════════════════════════════════════════════════╗
║ SCENARIO 1: NORMAL TYPING ║
╠═══════════════════════════════════════════════════════════════════════════════╣
║ ║
║ You type: "ls -la" (6 keystrokes) ║
║ ║
║ Traditional: 6 × 50,000 bytes = 300,000 bytes sent ║
║ Monolex: 6 × 1,254 bytes = 7,524 bytes sent ║
║ ║
║ Reduction: 97.5% ║
║ ║
╚═══════════════════════════════════════════════════════════════════════════════╝
╔═══════════════════════════════════════════════════════════════════════════════╗
║ SCENARIO 2: AI STREAMING (Claude, ChatGPT) ║
╠═══════════════════════════════════════════════════════════════════════════════╣
║ ║
║ AI generates 1000 tokens of code ║
║ ║
║ Traditional: Constant full-screen updates → CPU spike, UI freeze ║
║ Monolex: Only changed lines sent → Smooth, responsive ║
║ ║
║ This is why Monolex handles AI streaming so well! ║
║ ║
╚═══════════════════════════════════════════════════════════════════════════════╝
Pillar 3: Direct Display
Other terminals process data multiple times. Monolex does it once:Copy
┌─────────────────────────────────────────────────────────────────┐
│ TRADITIONAL TERMINAL PATH │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Data arrives │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Process 1 │ ← Decode bytes │
│ └──────┬──────┘ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Process 2 │ ← Parse commands │
│ └──────┬──────┘ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Process 3 │ ← Convert format │
│ └──────┬──────┘ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Process 4 │ ← Prepare display │
│ └──────┬──────┘ │
│ ▼ │
│ Screen │
│ │
│ 4 steps = slow, wasteful │
│ │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ MONOLEX PATH │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Data arrives │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────┐ │
│ │ Native Processing (Rust) │ ← All at once! │
│ │ • Decode │ │
│ │ • Parse │ │
│ │ • Convert │ │
│ └──────────────┬──────────────────┘ │
│ ▼ │
│ ┌─────────────────────────────────┐ │
│ │ Direct Injection │ ← Straight to display │
│ └──────────────┬──────────────────┘ │
│ ▼ │
│ Screen │
│ │
│ 2 steps = fast, efficient │
│ │
└─────────────────────────────────────────────────────────────────┘
Real Impact
CPU Usage
Copy
Other terminals during AI streaming:
CPU: ████████████████████ 80%+
Monolex during AI streaming:
CPU: ████ 20%
Smoothness
Copy
Other terminals:
Frames: ▓░▓░▓░▓░ (jittery)
Monolex:
Frames: ████████ (smooth)
The Complete Picture
Copy
┌─────────────────────────────────────────────────────────────────┐
│ │
│ MONOLEX ARCHITECTURE │
│ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Your Programs │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ ┌────────────────────────────────────────────┐ │ │
│ │ │ RUST ENGINE (Native Speed) │ │ │
│ │ │ │ │ │
│ │ │ • Blazing fast processing │ │ │
│ │ │ • Low memory usage │ │ │
│ │ │ • No garbage collection pauses │ │ │
│ │ └────────────────────────────────────────────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ ┌────────────────────────────────────────────┐ │ │
│ │ │ SMART DIFF (Only Changes) │ │ │
│ │ │ │ │ │
│ │ │ • Detects what changed │ │ │
│ │ │ • Skips unchanged content │ │ │
│ │ │ • 99% less data to process │ │ │
│ │ └────────────────────────────────────────────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ ┌────────────────────────────────────────────┐ │ │
│ │ │ DIRECT DISPLAY (Injection) │ │ │
│ │ │ │ │ │
│ │ │ • Bypasses slow paths │ │ │
│ │ │ • Straight to GPU │ │ │
│ │ │ • Maximum efficiency │ │ │
│ │ └────────────────────────────────────────────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ Your Screen │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Comparison Summary
Copy
┌─────────────────────────────────────────────────────────────────┐
│ │
│ PERFORMANCE COMPARISON │
│ │
│ Feature Traditional Monolex │
│ ────────────────────────────────────────────── │
│ │
│ Processing Engine JavaScript Rust (Native) │
│ (slow) (fast) │
│ │
│ Data Transfer Full screen Only changes │
│ (100%) (~1-5%) │
│ │
│ Display Path Multiple Direct │
│ conversions injection │
│ │
│ AI Streaming Struggles Smooth │
│ (high CPU) (low CPU) │
│ │
│ Battery Impact High drain Minimal │
│ │
└─────────────────────────────────────────────────────────────────┘
Summary
Copy
╔═══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ WHY MONOLEX IS FAST - ONE PICTURE ║
║ ║
║ ┌──────────────────┐ ║
║ │ NATIVE SPEED │ Process commands in native code ║
║ │ (Rust) │ = Fastest possible processing ║
║ └────────┬─────────┘ ║
║ │ ║
║ ▼ ║
║ ┌──────────────────┐ ║
║ │ SMART UPDATES │ Send only what changed ║
║ │ (Diff) │ = 99% less work ║
║ └────────┬─────────┘ ║
║ │ ║
║ ▼ ║
║ ┌──────────────────┐ ║
║ │ DIRECT DISPLAY │ Skip unnecessary steps ║
║ │ (Injection) │ = Instant on screen ║
║ └────────┬─────────┘ ║
║ │ ║
║ ▼ ║
║ ╔══════════════════╗ ║
║ ║ SMOOTH, FAST ║ ║
║ ║ TERMINAL ║ ║
║ ╚══════════════════╝ ║
║ ║
╚═══════════════════════════════════════════════════════════════════════════════╝
All of this happens automatically. You don’t need to configure anything. Just use Monolex and enjoy the speed!
Next Steps
Smooth Rendering
Learn how Monolex eliminates flicker completely.
Troubleshooting
Having issues? Check our troubleshooting guide.