- Create engine/display/ package with registry pattern - Move displays to engine/display/backends/ (terminal, null, websocket, sixel) - Add DisplayRegistry with auto-discovery - Add benchmark.py for performance testing effects × displays matrix - Add mise tasks: benchmark, benchmark-json, benchmark-report - Update controller to use new display module
33 lines
751 B
Python
33 lines
751 B
Python
"""
|
|
Null/headless display backend.
|
|
"""
|
|
|
|
import time
|
|
|
|
|
|
class NullDisplay:
|
|
"""Headless/null display - discards all output."""
|
|
|
|
width: int = 80
|
|
height: int = 24
|
|
|
|
def init(self, width: int, height: int) -> None:
|
|
self.width = width
|
|
self.height = height
|
|
|
|
def show(self, buffer: list[str]) -> None:
|
|
from engine.display import get_monitor
|
|
|
|
monitor = get_monitor()
|
|
if monitor:
|
|
t0 = time.perf_counter()
|
|
chars_in = sum(len(line) for line in buffer)
|
|
elapsed_ms = (time.perf_counter() - t0) * 1000
|
|
monitor.record_effect("null_display", elapsed_ms, chars_in, chars_in)
|
|
|
|
def clear(self) -> None:
|
|
pass
|
|
|
|
def cleanup(self) -> None:
|
|
pass
|