Huella mínima. Máximo rendimiento.
Lyx soporta Energy-Aware-Compiling para generar código máquina eficiente en energía, controlado vía CLI o pragmas a nivel de función.
# Compile with energy level 1 (battery-optimized, minimal power) ./lyxc program.lyx -o program --target-energy=1 # Compile with energy level 3 (balanced, default) ./lyxc program.lyx -o program --target-energy=3 # Compile with energy level 5 (maximum performance) ./lyxc program.lyx -o program --target-energy=5
// This function compiles with level 1 (battery-optimized) @energy(1) fn low_power_task(): int64 { var sum: int64 := 0; var i: int64 := 0; while i < 1000 { sum := sum + i; i := i + 1; } return sum; } // This function compiles with level 5 (maximum performance) @energy(5) fn compute_intensive(): int64 { var result: int64 := 0; // Heavy computation uses SIMD/FPU return result; } fn main(): int64 { var x: int64 := low_power_task(); var y: int64 := compute_intensive(); return x + y; }
Minimal binary size means minimal energy consumption. Lyx binaries are designed to be efficient from the ground up.
A partir de solo 4KB, los binarios de Lyx requieren mínimo espacio en disco y memoria.
La pequeña huella de memoria hace a Lyx perfecto para sistemas embebidos y entornos restringidos.
Binarios más pequeños significan menos energía para almacenamiento, transmisión y ejecución.
| Idioma | Tamaño Binario | Runtime | Uso de Memoria |
|---|---|---|---|
| Go | ~2 MB | ~10 MB | ~5 MB |
| Rust | ~800 KB | ~2 MB | ~1 MB |
| Python | N/A | ~50 MB | ~20 MB |
| Lyx | 4-42 KB | 0 KB | <1 MB |
The compiler outputs detailed energy statistics after compilation
=== Energy Statistics === Energy level: 3 CPU family: 1 Optimize for battery: TRUE Avoid SIMD: TRUE Avoid FPU: FALSE Cache locality: TRUE Register over memory: TRUE Total ALU operations: 42 Total FPU operations: 0 Total SIMD operations: 0 Total memory accesses: 17 Total branches: 8 Total syscalls: 3 Estimated energy units: 16955 Code size: 846 bytes L1 cache footprint: 846 bytes