{"id":35165192,"url":"https://github.com/srdjan/zigttp","last_synced_at":"2026-01-31T04:00:36.854Z","repository":{"id":330580074,"uuid":"1122385047","full_name":"srdjan/zigttp","owner":"srdjan","description":"Small Native Zig JavaScript runtime that started as port of mquickjs to Zig... and... grew up to something bigger","archived":false,"fork":false,"pushed_at":"2026-01-27T21:39:17.000Z","size":2297,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-28T01:46:39.357Z","etag":null,"topics":["html","htmx","http","http-server","json","quickjs","web","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srdjan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-24T16:04:27.000Z","updated_at":"2026-01-27T21:39:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/srdjan/zigttp","commit_stats":null,"previous_names":["srdjan/zigttp"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/srdjan/zigttp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srdjan%2Fzigttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srdjan%2Fzigttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srdjan%2Fzigttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srdjan%2Fzigttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srdjan","download_url":"https://codeload.github.com/srdjan/zigttp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srdjan%2Fzigttp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28928627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T02:59:34.861Z","status":"ssl_error","status_checked_at":"2026-01-31T02:59:05.369Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","htmx","http","http-server","json","quickjs","web","zig"],"created_at":"2025-12-28T19:27:26.057Z","updated_at":"2026-01-31T04:00:36.841Z","avatar_url":"https://github.com/srdjan.png","language":"Zig","readme":"# zigttp - Serverless JavaScript Runtime\n\n\u003e **Note**: This project is experimental and under active development.\n\nA high-performance serverless JavaScript runtime for FaaS (Function-as-a-Service) use cases, powered by **zts** - a pure Zig JavaScript engine. Designed for AWS Lambda, Azure Functions, Cloudflare Workers, and edge computing deployments.\n\n---\n\n## Key Features\n\n### Runtime Performance\n\n- **Sub-millisecond cold starts** - No JIT warm-up overhead, predictable startup times\n- **Zero external dependencies** - Pure Zig implementation, single static binary\n- **Inline caching with hidden classes** - V8-style property access optimization\n- **Polymorphic inline cache (PIC)** - 8-entry cache with last-hit optimization for O(1) monomorphic lookups\n- **Lazy string hashing** - Hash computation deferred until needed, reducing allocation overhead\n- **Binary search for large objects** - O(log n) property lookup for objects with 8+ properties\n- **NaN-boxing** - 64-bit tagged values storing integers, floats, and pointers in a single word\n\n### HTTP/FaaS Optimizations\n\n- **Shape preallocation** - Zero hidden class transitions for Request/Response objects\n- **Pre-interned HTTP atoms** - 27 common headers (content-type, authorization, cache-control, CORS headers, etc.) with O(1) lookup\n- **HTTP string caching** - Pre-allocated status texts and content-type strings\n- **LockFreePool handler isolation** - Pre-warmed contexts with O(1) slot acquisition\n- **Adaptive backoff** - Three-phase contention handling (spin, sleep with jitter, circuit breaker)\n- **Zero-copy response** - Borrowed mode for body and headers avoids memcpy\n- **LRU static file cache** - Doubly-linked list eviction eliminates latency spikes\n\n### Memory Management\n\n- **Generational GC** - Nursery + tenured spaces with write barrier tracking\n- **Hybrid arena allocation** - Request-scoped memory with O(1) bulk reset\n- **Escape detection** - Write barriers prevent arena objects from leaking\n- **GC disabled in hybrid mode** - No collection pauses during request handling\n\n### Language Support\n\n- **ES5 + ES6 extensions** - Strict mode JavaScript with modern features\n- **Native TypeScript/TSX** - Type stripping at load time, no build step required\n- **Compile-time evaluation** - `comptime()` function for constant folding\n- **JSX/TSX support** - Direct parsing with server-side rendering\n\n### JIT Compilation\n\n- **Baseline JIT compiler** - x86-64 and ARM64 native code generation\n- **Inline cache integration** - JIT fast paths for property access\n- **Object literal shapes** - Pre-compiled hidden classes with arena fast path allocation\n- **Type feedback** - Call site profiling with megamorphic early exit\n- **Adaptive compilation** - Hot functions compiled after 5 executions (tuned for FaaS warmup)\n\n### Developer Experience\n\n- **Fetch-like API** - Response.json(), Response.text(), Response.html()\n- **Static file serving** - Built-in with configurable cache\n- **CORS support** - Single flag to enable\n- **Pool metrics** - Real-time monitoring of handler pool utilization\n\n## Use Cases\n\n- AWS Lambda / Azure Functions / Cloudflare Workers style deployments\n- Edge computing with JavaScript handlers\n- Lightweight HTTP function handlers\n- Multi-tenant request processing\n\n## Quick Start\n\n### 1. Build\n\n```bash\nzig build -Doptimize=ReleaseFast\n\n# Or with build-time handler precompilation (fastest cold starts)\nzig build -Doptimize=ReleaseFast -Dhandler=examples/handler.ts\n```\n\n### 2. Run\n\n```bash\n# Inline handler\n./zig-out/bin/zigttp-server -e \"function handler(r) { return Response.json({hello:'world'}) }\"\n\n# Or with a handler file\n./zig-out/bin/zigttp-server examples/handler.ts\n\n# Test it\ncurl http://localhost:8080/\n```\n\n## Usage\n\n```\nzigttp-server [options] \u003chandler.js\u003e\nzigttp-server -e \"\u003cinline-code\u003e\"\n\nOptions:\n  -p, --port \u003cPORT\u003e     Port to listen on (default: 8080)\n  -h, --host \u003cHOST\u003e     Host to bind to (default: 127.0.0.1)\n  -e, --eval \u003cCODE\u003e     Evaluate inline JavaScript handler\n  -m, --memory \u003cSIZE\u003e   JS runtime memory limit (default: 0 = no limit)\n  -n, --pool \u003cN\u003e        Runtime pool size (default: auto = 2 * cpu, min 8)\n  -q, --quiet           Disable request logging\n  --cors                Enable CORS headers\n  --static \u003cDIR\u003e        Serve static files from directory\n  --help                Show help message\n```\n\n## Handler API\n\nYour handler must define a `handler` function that receives a request object and\nreturns a Response.\n\n### Request Object\n\n```javascript\n{\n    method: string,     // \"GET\", \"POST\", etc.\n    url: string,        // URL path (e.g., \"/api/users\")\n    headers: object,    // HTTP headers\n    body: string|null   // Request body (for POST/PUT)\n}\n```\n\n### Response Helpers\n\n```javascript\n// JSON response (sets Content-Type automatically)\nResponse.json(data, init?)\n\n// Text response  \nResponse.text(text, init?)\n\n// HTML response\nResponse.html(html, init?)\n\n// Redirect response (default status: 302)\nResponse.redirect(url, status?)\n```\n\n### Example Handler\n\n```javascript\nfunction handler(request) {\n    // Simple routing\n    if (request.url === \"/\") {\n        return Response.html(\"\u003ch1\u003eHello World\u003c/h1\u003e\");\n    }\n\n    if (request.url === \"/api/echo\") {\n        return Response.json({\n            method: request.method,\n            url: request.url,\n            body: request.body,\n        });\n    }\n\n    if (request.method === \"POST\" \u0026\u0026 request.url === \"/api/data\") {\n        const data = JSON.parse(request.body);\n        return Response.json({ received: data, ok: true });\n    }\n\n    // 404 fallback\n    return Response.text(\"Not Found\", { status: 404 });\n}\n```\n\n## Advanced Server Configuration (Zig API)\n\nIf you embed `Server` directly in Zig, these `ServerConfig` fields tune the new\nperformance features:\n\n```zig\nconst config = ServerConfig{\n    .pool_wait_timeout_ms = 5,\n    .pool_metrics_every = 1000,\n    .static_cache_max_bytes = 2 * 1024 * 1024,\n    .static_cache_max_file_size = 128 * 1024,\n};\n```\n\nWhen `pool_metrics_every` is set, logs include a line like:\n\n```\nPool metrics: in_use=2/8 exhausted=0 avg_wait_us=3 max_wait_us=20 avg_exec_us=120 max_exec_us=500\n```\n\nFields are the current in-use count, pool size, exhausted acquisitions, and\naverage/max wait and execution time (microseconds).\n\n## JSX Support\n\nzigttp-server parses JSX directly (no separate transform step). Use `.jsx` files\nto write handlers with JSX syntax.\n\n### Basic JSX\n\n```jsx\n// examples/jsx-simple.jsx\nfunction handler(request) {\n    const page = \u003cdiv class=\"hello\"\u003eHello JSX!\u003c/div\u003e;\n    return Response.html(renderToString(page));\n}\n```\n\n### Components\n\n```jsx\nfunction Card(props) {\n    return (\n        \u003cdiv class=\"card\"\u003e\n            \u003ch2\u003e{props.title}\u003c/h2\u003e\n            \u003cdiv\u003e{props.children}\u003c/div\u003e\n        \u003c/div\u003e\n    );\n}\n\nfunction handler(request) {\n    const page = \u003cCard title=\"Welcome\"\u003eHello from JSX!\u003c/Card\u003e;\n    return Response.html(renderToString(page));\n}\n```\n\n### JSX Runtime API\n\n- **`h(tag, props, ...children)`** - Create virtual DOM node (used internally by\n  JSX codegen)\n- **`renderToString(node)`** - Render virtual DOM to HTML string\n- **`Fragment`** - Fragment component for grouping without wrapper element\n\n### JSX Features\n\n| Feature       | Example              | Output               |\n| ------------- | -------------------- | -------------------- |\n| Elements      | `\u003cdiv\u003etext\u003c/div\u003e`    | `\u003cdiv\u003etext\u003c/div\u003e`    |\n| Attributes    | `\u003cdiv class=\"foo\"\u003e`  | `\u003cdiv class=\"foo\"\u003e`  |\n| Expressions   | `\u003cdiv\u003e{value}\u003c/div\u003e` | `\u003cdiv\u003e...\u003c/div\u003e`     |\n| Components    | `\u003cCard title=\"x\"/\u003e`  | Calls Card function  |\n| Fragments     | `\u003c\u003ea\u003c/\u003e`             | `a` (no wrapper)     |\n| Self-closing  | `\u003cbr/\u003e`              | `\u003cbr /\u003e`             |\n| Boolean attrs | `\u003cinput disabled/\u003e`  | `\u003cinput disabled /\u003e` |\n\n### Full SSR Example\n\n```jsx\n// examples/jsx-ssr.jsx\nfunction Layout(props) {\n    return (\n        \u003chtml\u003e\n            \u003chead\u003e\n                \u003ctitle\u003e{props.title}\u003c/title\u003e\n            \u003c/head\u003e\n            \u003cbody\u003e\n                \u003ch1\u003e{props.title}\u003c/h1\u003e\n                {props.children}\n            \u003c/body\u003e\n        \u003c/html\u003e\n    );\n}\n\nfunction handler(request) {\n    const page = (\n        \u003cLayout title=\"My App\"\u003e\n            \u003cp\u003eMethod: {request.method}\u003c/p\u003e\n        \u003c/Layout\u003e\n    );\n    return Response.html(renderToString(page));\n}\n```\n\n## TypeScript Support\n\nzts includes a native TypeScript/TSX stripper that removes type annotations at\nload time. Use `.ts` or `.tsx` files directly without a separate build step.\n\n### Basic Usage\n\n```typescript\n// handler.ts\ninterface Request {\n    method: string;\n    path: string;\n    headers: Record\u003cstring, string\u003e;\n    body: string | null;\n}\n\nfunction handler(request: Request): Response {\n    const data: { message: string } = { message: \"Hello TypeScript!\" };\n    return Response.json(data);\n}\n```\n\n### Compile-Time Evaluation\n\nThe `comptime()` function evaluates expressions at load time and replaces them\nwith literal values:\n\n```typescript\n// Arithmetic\nconst x = comptime(1 + 2 * 3); // -\u003e const x = 7;\n\n// String operations\nconst upper = comptime(\"hello\".toUpperCase()); // -\u003e const upper = \"HELLO\";\n\n// Math functions\nconst pi = comptime(Math.PI); // -\u003e const pi = 3.141592653589793;\nconst max = comptime(Math.max(1, 5, 3)); // -\u003e const max = 5;\n\n// Hash function (FNV-1a)\nconst etag = comptime(hash(\"content-v1\")); // -\u003e const etag = \"a1b2c3d4\";\n\n// JSON parsing\nconst cfg = comptime(JSON.parse('{\"a\":1}')); // -\u003e const cfg = ({a:1});\n\n// TSX works too\nconst el = \u003cdiv\u003e{comptime(1 + 2)}\u003c/div\u003e; // -\u003e \u003cdiv\u003e{3}\u003c/div\u003e\n```\n\n### Supported comptime Operations\n\n| Category   | Operations                                                          |\n| ---------- | ------------------------------------------------------------------- |\n| Literals   | number, string, boolean, null, undefined, NaN, Infinity             |\n| Arithmetic | `+ - * / % **`                                                      |\n| Bitwise    | `\\| \u0026 ^ \u003c\u003c \u003e\u003e \u003e\u003e\u003e`                                                  |\n| Comparison | `== != === !== \u003c \u003c= \u003e \u003e=`                                           |\n| Logical    | `\u0026\u0026 \\|\\| ??`                                                        |\n| Ternary    | `cond ? a : b`                                                      |\n| Math       | PI, E, floor, ceil, round, sqrt, sin, cos, min, max, etc.           |\n| String     | length, toUpperCase, toLowerCase, trim, slice, split, replace, etc. |\n| Built-in   | parseInt, parseFloat, JSON.parse, hash                              |\n\nDisallowed: variables, Date.now(), Math.random(), closures, assignments.\n\nSee [docs/typescript-comptime-spec.md](docs/typescript-comptime-spec.md) for the\nfull specification.\n\n## JavaScript Subset\n\nzts implements ES5 with some ES6+ extensions. Key limitations:\n\n- **Strict mode only**: No `with`; `var` is not supported (use `let`/`const`)\n- **No array holes**: `[1,,3]` is a syntax error\n- **No direct eval**: Only global eval `(1, eval)('code')`\n- **No value boxing**: No `new Number(1)`, `new String('x')`\n- **Limited Date**: Only `Date.now()` is available\n\nSupported ES6+ features:\n\n- `for...of` (arrays only)\n- Typed arrays\n- `\\u{hex}` in strings\n- `Math.imul`, `Math.clz32`, `Math.fround`, `Math.trunc`\n- Exponentiation operator (`**`)\n- `String.prototype.codePointAt`, `replaceAll`, `trimStart`, `trimEnd`\n- `globalThis`\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                     zigttp-server (Zig)                       │\n├─────────────────────────────────────────────────────────────┤\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │\n│  │ HTTP Server │──│ HandlerPool │──│  Builtins/HTTP     │  │\n│  │  (std.net)  │  │  (contexts) │  │  (Response, h())   │  │\n│  └─────────────┘  └─────────────┘  └─────────────────────┘  │\n├─────────────────────────────────────────────────────────────┤\n│                    zts (Pure Zig)                      │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │\n│  │   Parser    │──│  Bytecode   │──│  Generational GC    │  │\n│  │             │  │     VM      │  │ (Nursery + Tenured) │  │\n│  └─────────────┘  └─────────────┘  └─────────────────────┘  │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### Runtime Model\n\nzts uses a **generational garbage collector** with:\n\n1. NaN-boxing for efficient value representation (64-bit tagged values)\n2. Hidden classes for inline caching (V8-style optimization)\n3. LockFreePool-backed handler pool for request isolation in FaaS environments\n4. Hybrid arena allocation for request-scoped memory with O(1) reset\n\nThe Result\u003cT\u003e pattern throughout makes error handling explicit and prevents\nsilent failures.\n\n## Project Structure\n\n```\nzigttp-server/\n├── build.zig              # Zig build configuration\n├── zts/                   # Pure Zig JavaScript engine\n│   ├── parser/            # Two-pass parser with IR\n│   │   ├── parse.zig      # Main parser (Pratt parser)\n│   │   ├── tokenizer.zig  # Tokenizer\n│   │   ├── codegen.zig    # Bytecode generation\n│   │   └── ir.zig         # Intermediate representation\n│   ├── interpreter.zig    # Stack-based bytecode VM\n│   ├── value.zig          # NaN-boxing value representation\n│   ├── object.zig         # Hidden classes, object system\n│   ├── gc.zig             # Generational GC (nursery + tenured)\n│   ├── heap.zig           # Size-class segregated allocator\n│   ├── arena.zig          # Request-scoped arena allocator\n│   ├── http.zig           # HTTP/JSX runtime for SSR\n│   ├── pool.zig           # Lock-free runtime pooling\n│   ├── builtins.zig       # Built-in JavaScript functions\n│   ├── stripper.zig       # TypeScript/TSX type stripper\n│   └── comptime.zig       # Compile-time expression evaluator\n├── src/\n│   ├── main.zig           # CLI entry point\n│   ├── zruntime.zig       # HandlerPool, JS context management\n│   ├── server.zig         # HTTP server implementation\n├── tools/\n│   └── precompile.zig     # Build-time bytecode compiler\n└── examples/\n    ├── handler.jsx        # Example JSX handler\n    ├── htmx-todo/         # HTMX Todo app example\n    └── jsx-ssr.jsx        # Full SSR example\n```\n\n## Building from Source\n\n### Prerequisites\n\n- Zig 0.16.0 or later (nightly)\n\n### Build Commands\n\n```bash\n# Debug build\nzig build\n\n# Release build (optimized)\nzig build -Doptimize=ReleaseFast\n\n# Release build with precompiled handler (production)\nzig build -Doptimize=ReleaseFast -Dhandler=examples/handler.ts\n\n# Run tests\nzig build test              # Main runtime tests\nzig build test-zts          # JS engine tests\nzig build test-zruntime     # Native Zig runtime tests\n\n# Run directly\nzig build run -- -e \"function handler(r) { return Response.json({ok:true}) }\"\n```\n\n## Extending with Native Functions\n\nAdd custom native functions callable from JavaScript by implementing the\n`NativeFn` signature in `zts/object.zig`:\n\n```zig\n// In a custom module:\n\nfn myNativeFunction(ctx: *zts.Context, this: zts.JSValue, args: []const zts.JSValue) !zts.JSValue {\n    // Your implementation\n    return zts.JSValue.fromInt(42);\n}\n\n// Register it via context.setGlobal()\n```\n\nSee `zts/builtins.zig` for examples of core JS APIs and native function wiring.\n\n## Performance\n\n### Benchmarks (QuickJS baseline)\n\nzts outperforms QuickJS in our historical benchmark runs (QuickJS is used only\nas an external baseline). See `benchmarks/*.json` for raw results.\n\n| Benchmark      | zts         | QuickJS    | Ratio           |\n| -------------- | ----------- | ---------- | --------------- |\n| stringOps      | 16.3M ops/s | 258K ops/s | **63x faster**  |\n| objectCreate   | 8.1M ops/s  | 1.7M ops/s | **4.8x faster** |\n| propertyAccess | 13.2M ops/s | 3.4M ops/s | **3.9x faster** |\n| httpHandler    | 1.0M ops/s  | 332K ops/s | **3.1x faster** |\n| functionCalls  | 12.4M ops/s | 5.1M ops/s | **2.4x faster** |\n| stringConcat   | 8.3M ops/s  | 6.2M ops/s | **1.3x faster** |\n| arrayOps       | 8.7M ops/s  | 6.6M ops/s | **1.3x faster** |\n| jsonOps        | 77K ops/s   | 71K ops/s  | **1.1x faster** |\n\nRun benchmarks with: `./zig-out/bin/zigttp-bench`\n\n### HTTP Throughput (Deno baseline)\n\n| Endpoint         | zigttp RPS | Deno Baseline | Ratio |\n| ---------------- | ---------- | ------------- | ----- |\n| /api/health      | 79,743     | 104,672       | 0.76x |\n| /api/echo        | 79,409     | 63,726        | 1.25x |\n| /api/greet/world | 80,030     | 105,016       | 0.76x |\n\nNote: JIT compilation is enabled by default for hot functions (after\n`JIT_THRESHOLD` executions). Optional instrumentation (perf.zig) and parallel\ncompiler (compiler.zig) modules exist in `zts/` but are not exported.\n\n### FaaS Optimizations\n\n- **Cold start**: \u003c 1ms to initialize runtime and load handler\n- **Build-time precompilation**: `-Dhandler=\u003cpath\u003e` embeds bytecode directly, eliminating all runtime parsing\n- **Warm invocations**: HandlerPool reuses pre-warmed contexts\n- **Memory**: 256KB default JS heap (configurable per function)\n- **Deployment size**: ~500KB binary, zero runtime dependencies\n\n### Request Pipeline Optimizations\n\nThe server includes several optimizations for low-latency request handling:\n\n- **O(1) pool slot acquisition**: `free_hint` atomic tracks likely-free slots, avoiding linear scan\n- **Pre-interned HTTP atoms**: Common headers (content-type, host, user-agent, etc.) use predefined atoms for O(1) lookup\n- **LRU static cache**: Doubly-linked list eviction instead of clear-all eliminates latency spikes\n- **Adaptive backoff**: Three-phase contention handling (spin, sleep with jitter, circuit breaker)\n- **Zero-copy response**: Borrowed mode for body and headers avoids memcpy\n- **Relaxed atomics**: Metrics-only counters use `.monotonic` ordering\n\n### Hybrid Arena Allocation\n\nFor request-scoped workloads, zts uses a hybrid memory model:\n\n- **Arena allocator**: O(1) bulk reset between requests, zero per-object\n  overhead\n- **Escape detection**: Write barriers prevent arena objects from leaking into\n  persistent storage\n- **GC disabled in hybrid mode**: No collection pauses during request handling\n\nThis design eliminates GC latency spikes in FaaS environments while maintaining\nmemory safety.\n\n### Deployment Patterns\n\n```bash\n# Single instance (Lambda-style)\n./zigttp-server handler.js\n\n# Multiple instances behind load balancer\n# Each instance handles one request at a time for isolation\n```\n\nFor high-throughput scenarios, deploy multiple instances. The small binary size\nand instant cold starts make horizontal scaling efficient.\n\n## License\n\nMIT licensed.\n\n## Credits\n\n- **zts** - Pure Zig JavaScript engine (part of this project)\n- [Zig](https://ziglang.org/) programming language\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrdjan%2Fzigttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrdjan%2Fzigttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrdjan%2Fzigttp/lists"}