5 releases
Uses new Rust 2024
| 0.8.5-alpha | Dec 3, 2025 |
|---|---|
| 0.8.3-alpha | Nov 27, 2025 |
| 0.8.2-alpha | Nov 12, 2025 |
| 0.8.1-alpha | Nov 9, 2025 |
| 0.8.0-alpha | Nov 7, 2025 |
#408 in Database implementations
630KB
13K
SLoC
LLKV SQL Pong Demo App
A terminal UI (TUI) app that plays a game of Pong against itself.
Most of the game logic is implemented in SQL so this demo can be used to evaluate and benchmark the SQL engine in the LLKV toolkit.
Quick Start
Run the demo from the workspace root:
cargo run -p llkv-sql-pong-demo --release
Controls
- ESC: Quit the game
- S: Toggle sound effects (score beeps and paddle hits)
- +: Double framerate (30 → 60 → 120 → MAX)
- -: Halve framerate (back down to 15 FPS minimum)
- MAX mode: Shows actual FPS the SQL engine can deliver (no frame limiting)
Performance Notes
The framerate controls let you stress-test LLKV's query execution speed:
- 30 FPS (default): Smooth gameplay, ~33ms per frame
- 60 FPS: Increased pace, ~16ms per frame
- 120 FPS: Fast-paced action, ~8ms per frame
- MAX mode: Removes frame limiting to measure full-speed execution (typically 200-600+ FPS depending on hardware). The UI performs incremental updates to minimize terminal rendering overhead, though the engine can execute SQL queries faster than any terminal can physically refresh.
Each frame executes a complete SQL query with multiple subqueries handling "AI" decisions, physics, collision detection, and scoring. The framerate controls make this demo useful for benchmarking SQL execution performance under different workloads, though MAX mode measures end-to-end loop time including UI rendering.
Note: Compiling for release mode (
--release) will give much better framerates. Debug builds are significantly slower.

Attribution
This code is a modified version of https://github.com/Zeutschler/duckdb-pong-in-sql, ported to Rust, and the SQL queries have been substantially modified along the way.
License
Licensed under the Apache-2.0 License.
Dependencies
~44MB
~764K SLoC