Skip to content

Altair v0.2.0

Choose a tag to compare

@HMH-3080 HMH-3080 released this 06 Aug 16:12
· 4 commits to main since this release

Performance

  • SQL statements are built once per connection (Record::Model + Connection#sql_template): find, find_by_* and insert cache their quoted statements instead of rebuilding them per call — the write path allocates half as much (frozen-GC harness, PostgreSQL: Item.create 2,033 → 964 B/op, Item.find 1,378 → 1,060 B/op).
  • Route-lookup LRU cache: repeated paths collapse to a hash lookup (config.router_cache_size, default 1024) — measured ~10x on hot paths with zero per-request routing allocations.
  • Route resolution is a single scan: matching and the 405 method list come from one pass; candidate lists merge without allocation.
  • Lazy request parsing: query string, JSON body and the params bag parse on first access (bare GET: 784 → 368 B/op).
  • Lock-free Record.connection steady path, parallel execution on boot, warm pool defaults, and bounded admission control (db_max_active_queries + db_admission_timeout) that parks excess load outside the pool.

Framework

  • Controller hardening wave: before_action / after_action / skip_* callbacks with inheritance, controller-level rescue_from, respond_to, JSON-object rendering, redirect_back, request.format, JSON request bodies, clean head, chunked stream, segment-based route index, find_each keeping filters + preloaders, COUNT(*) relation counting, development N+1 detector, granular on_query_event instrumentation, Connection#pool_stats.

Benchmarks

  • New committed benchmark harness (examples/benchmark_k6) vs Express and Fiber on identical PostgreSQL CRUD under k6: 1,000 VUs / 60 s sustained, equal 200-connection budget, warm-up excluded from measurement.
  • Write (POST /items): Altair 13,167 req/s (1.81x Express) — write p99.9 145.9 ms (7x tighter than Express), write max 201.5 ms, the best of all three.
  • Read (GET /items/:id): Altair 14,687 req/s (1.91x Express), p99.9 318.4 ms / max 479.6 ms.
  • Zero failed requests in all six runs. Full report, methodology and the tail-latency investigation in the harness README; the website gained a dedicated Benchmarks page.

CLI / Release infrastructure

  • altair update (self-update with SHA-256 verification, --check, --force), app-context command delegation from any directory, one-command installers for Linux/macOS/Windows with checksum enforcement, altair install onto PATH.