A loja já está disponível

Construímos máquinas Workstation AI para websites, agentes de IA e treino de LLM – configure e compre online.

Obter preços para revendedores
Produtos de IA
Laboratórios de IAAgentes OpenAIAgentes ClaudeBot GrokCRM nativo de IA Workstation AIMarketingTodos os produtos
Soluções de IA
IA aplicadaAgentes de IAIA generativaAutomação com IAFormação em IAPacotes de IA para PMELaboratório de IA empresarialWorkstations de IAHardware e software NVIDIAComputação acelerada NVIDIAIA privadaCloud privada de GPUClusters de GPUIA na edgeIA por setor
Serviços de IA
Modernização de plataformasEngenharia digitalFundações de dados e IAOperações autónomasConsultoria de IAAutomação DevOpsCibersegurançaDesenvolvimento de softwareCriação de agentesConfiguração de MLOpsLeasing de GPUCloud privada de GPU
Sobre nós
EmpresaA nossa históriaParceirosHistórias de clientes
Centros de dados de IA
Centros de dados de IACloud privada de GPUClusters de GPULeasing de GPU
Perspetivas sobre IASérie JevLaboratório de benchmarksSeleção de modelos
Notas técnicas
Documentação
Sistema operativo LinuxUbuntuRed Hat Enterprise LinuxSUSE LinuxAlpine LinuxDebian, Rocky e AlmaLinux
Plataformas de IA na cloudAWS e Amazon BedrockGoogle Cloud e Vertex AIMicrosoft Azure e AI FoundryClouds de GPU e marketplaces
Centros de dados de IA privadosPara escritórios de advogadosPara empresas de contabilidadePlataformas on-premisesCloud totalmente protegida
FerramentasRing PromoterJobshout
Notícias
Blogue
Contacte-nosIniciar sessão

Workstations de IA, software de IA multiagente, infraestrutura de GPU e soluções de agentes inteligentes para empresas modernas.

Contacte-nos

Soluções de IA

IA aplicadaAgentes de IAIA generativaAutomação com IAFormação em IAPacotes de IA para PMELaboratório de IA empresarialIA por setor

Produtos

Todos os produtosCRM e ERP nativos de IA Workstation AIMarketingAgentes OpenAIRing PromoterJobshout

Empresa

Sobre nósEmpresaCentros de dados de IAPorquê a WorkstationParceirosHistórias de clientesPreçosContactoTenthMatrix

Recursos

Perspetivas sobre IANotas técnicasDocumentaçãoSistema operativo LinuxPlataformas de IA na cloudCentros de dados de IA privadosBloguePesquisarMapa do site
Escritório na Bélgica
Workstation SRL, Rue Vanderkindere 34, 1180 Uccle, BrusselsBE 0751.518.683Seg – Sex: 9h00 – 18h00 CET
+32 492 45 67 46
Sede no Reino Unido
77-79 Marlowes, Hemel Hempstead HP1 1LFIndicações – saia na junção 20 da M25 (Outer London)N.º de registo da empresa: 11641870Seg – Sex: 9h00 – 18h00 GMT
+44 7515 356 146
Escritório na Índia
#159 Sector 9, Pocket 1, DDA Flats, 110077 Dwarka, New Delhi
+91 98881 98841
Escritório em Taiwan
3F, No. 2-4, Aisi Rd., Ren'ai Dist., Keelung City 200, Taiwan基隆市仁愛區愛四路2之4號3樓Seg – Sex: 9h00 – 18h00, hora de Taiwan (GMT+8)
+886 926 892 701+32 492 45 67 46
Escritório na Estónia
Aleksander Puškini tn 30-25, 20306 Narva, EstoniaSeg - Sex: 9h00 - 18h00, hora da Estónia (EET)
+32 492 45 67 46

© 2000-2026 Balinder Singh Walia. Todos os direitos reservados.

O sítio web Workstation e todo o seu conteúdo, bem como as APIs e plugins associados, são protegidos por direitos de autor de Balinder Singh Walia. balinder.walia@gmail.com

PrivacidadeEliminação de dadosCookiesTermos de serviçoMapa do site

NVIDIA, o logótipo NVIDIA, RTX, RTX PRO, Blackwell, CUDA, NVLink, MGX, Omniverse, Spectrum-X, Quantum, BlueField, DGX e HGX são marcas comerciais e/ou marcas registadas da NVIDIA Corporation nos EUA e noutros países. AMD, o logótipo AMD Arrow, EPYC, Instinct, Ryzen e Threadripper são marcas comerciais da Advanced Micro Devices, Inc. Dell e PowerEdge são marcas comerciais da Dell Inc. ou das suas subsidiárias. Intel e Xeon são marcas comerciais da Intel Corporation ou das suas subsidiárias. AMAX, AceleMax e LiquidMax são marcas comerciais da AMAX Engineering Corporation. Todos os outros nomes de produtos, logótipos e marcas são propriedade dos respetivos proprietários. Utilizamo-los apenas para identificar os produtos que descrevemos, fornecemos ou suportamos; a sua utilização não significa que os respetivos proprietários nos recomendem.

Início / Notas técnicas / Technology
DevOpsArchitecturePerformanceRustGoBun.jsJavaKotlinLuaPythonnjs

Polyglot Benchmarks: Choosing the Right Tool for the Right Job

Eight runtimes (njs, Lua, Python, Go, Rust, Bun, Java, Kotlin), seven HTTP tests, reproducible Docker harness: decision matrix, ARB evidence, workflow-examples repo, and polyglot-benchmarks.fictionally.org live dashboard

16 de maio de 2026Technology11 min read

This is the long-form deep-dive. For a quicker, skim-readable version, see the companion blog post.

Polyglot Benchmarks cover — right tool, right job

1. Introduction: habit stacks vs real workloads

Technology choices in mature organisations rarely fail because nobody read a benchmark blog post. They fail because the process for choosing is weak: a loud senior engineer’s preference, a hiring pipeline full of one language, or a single impressive demo at a conference. Meanwhile the product mixes latency-sensitive APIs, batch reconciliation, edge authentication in NGINX, internal CLIs, and the occasional serverless spike. One runtime cannot be optimal for all of those shapes.

This article explains Polyglot Benchmarks — a live comparison dashboard and the open workflow-examples/benchmarks harness behind it — as a decision framework, not a fanboy leaderboard. The goal is evidence you can attach to an architecture decision record (ADR): same endpoints, same load generator, same container layout, multiple languages.

I will not invent throughput numbers in prose. When you run the harness, the dashboard shows measured req/s and latency percentiles for that hardware and Docker setup. Treat any static ranking here as qualitative patterns aligned with the harness’s test families and the dashboard’s built-in verdict copy.

Polyglot Benchmarks four-step approach: define workload, run harness, compare, decide
The decision framework at a glance — define the workload, run the harness, compare on the live dashboard, then decide with an ADR backed by measured evidence.

2. What is Polyglot Benchmarks?

Polyglot Benchmarks is hosted at polyglot-benchmarks.fictionally.org (Fictionally-branded infrastructure in the workflow-examples ecosystem). The landing headline compares:

  • NGINX njs — JavaScript modules inside stock NGINX
  • OpenResty Lua — Lua at the edge on OpenResty
  • Python FastAPI — Uvicorn ASGI app
  • Go net/http — standard library server
  • Rust Actix-web — async HTTP on Actix
  • Bun — JavaScript runtime with native HTTP server
  • Java (Javalin / Jetty) — lightweight JVM HTTP on Jetty
  • Kotlin (Ktor / Netty) — coroutine-friendly JVM HTTP on Netty

The live headline is an 8-language comparison: njs vs Lua vs Python vs Go vs Rust vs Bun vs Java vs Kotlin. The subtitle frames the intent: performance for long polling / chat / queue / API workloads — connection-heavy, JSON-heavy, and routing-heavy paths rather than a single “hello world” chariot race. JVM shops finally get the same fair surface as Go/Rust/Bun instead of a separate “enterprise” anecdote.

2.1 What the dashboard shows

While a run progresses, the UI polls /data/results.json every two seconds and renders:

  • Requests/sec (throughput) — aggregated from wrk per language per test
  • Average latency and P99 tail latency — in milliseconds from wrk’s latency model
  • TTFB (time to first byte) — from curl timing JSON alongside wrk
  • Summary table — per-test winners with ★ markers on best cells
  • Detailed test cards — bar charts and metric tables (P50, P90, P99.9, errors)
  • Latency percentile distribution — averaged across tests
  • Verdict — best for your use case — narrative once status is complete

That structure is deliberately ARB-friendly: charts for slides, tables for spreadsheets, narrative for the risk section of an ADR.

3. The workflow-examples harness

Everything reproducible lives under benchmarks/ in the workflow-examples repository. Top-level layout:

benchmarks/
  bench.sh              # orchestrates tests, writes results.json
  wrk_json.lua          # wrk done() → JSON summary (RPS, percentiles)
  docker-compose.yml    # eight app services + dashboard + bench runner
  njs/                  # NGINX + njs module
  lua/                  # OpenResty nginx.conf
  python/               # FastAPI + Dockerfile
  golang/               # net/http main.go
  rust/                 # Actix-web + Cargo
  bun/                  # Bun server.ts
  java/                 # Javalin on Jetty
  kotlin/               # Ktor on Netty
  dashboard/            # static index.html + nginx.conf

3.1 Docker Compose topology

docker-compose.yml defines isolated services on a shared network:

  • nginx-njs — port 8081, configs from ./njs
  • openresty-lua — port 8082
  • python-fastapi — port 8084, built from ./python
  • go-server — port 8085
  • rust-actix — port 8086
  • bun-server — port 8087
  • java-server — port 8088, Javalin / Jetty from ./java
  • kotlin-server — port 8089, Ktor / Netty from ./kotlin
  • dashboard — port 8083, serves HTML and mounts the results volume at /data
  • bench — Alpine container that installs curl, wrk, jq, waits for dependencies, runs bench.sh

The bench runner shares the results volume with the dashboard so results appear live without manual copy.

3.2 bench.sh methodology

The shell driver encodes fairness rules explicitly:

  • Duration: 10s per endpoint per language
  • Threads: 4
  • Connections: 100 concurrent
  • Warmup: 50 rounds hitting /hello on every server before timed tests
  • Per server: curl timing JSON (dns, connect, ttfb, total) plus wrk with wrk_json.lua

Seven tests are pipe-delimited in the script:

ID Name Intent Endpoint
1Plain TextBaseline — minimal response, framework overhead/hello
2JSON SerializationBuild and serialize 100-item JSON array/json
3CPU-Bound (fib 30)Recursive fibonacci(30) — pure CPU/cpu?n=30
4String ManipulationBuild, split, uppercase, rejoin 1000 segments/string
5Request InspectionHeaders, method, args → JSON/request_info?foo=bar&baz=123
6Subrequest + TransformInternal subrequest, parse JSON, transform/subrequest
7Routing LogicConditional routing on query params/route?action=greet&name=bench

Each language implements the same route surface (see golang/main.go, python/main.py, java/, kotlin/, NGINX configs, etc.) so differences reflect runtime and framework, not mismatched specs.

4. Why “polyglot” matters (without fanaticism)

Polyglot architecture does not mean every engineer learns eight languages. It means bounded contexts get a runtime that fits:

  • Edge plane — auth, rate limits, routing: Lua or njs inside NGINX you already operate
  • Core API plane — business logic with SLOs: Go or Rust
  • JVM plane — existing Spring/Jakarta estates, shared libraries, hiring depth: Java (Javalin) or Kotlin (Ktor)
  • Data plane — ETL, notebooks, ML glue: Python
  • Real-time JS plane — WebSockets, shared types with frontend: Bun or Node where velocity wins

Uniform stacks optimise HR and procurement. Polyglot benchmarks optimise fit per workload with measurable trade-offs on the table.

5. Dimensions that matter

Raw req/s is the metric that travels fastest on Slack. It is also the easiest to misread. Use a multi-column rubric:

Criterion Dominates when… Harness signal
p50 / p99 latencyUser-facing APIs, chat, long pollwrk latency percentiles; dashboard P99 chart
Throughput (RPS)High fan-out gateways, batch aggregatorswrk RPS; summary winner column
Memory per connectionThousands of idle WebSocketsQualitative + production profiling (not fully in harness)
TTFBCDN miss, cold paths, mobile networkscurl time_starttransfer in results JSON
LOC / complexityStartups, regulated change controlCompare implementations across folders
Build & CI timeFrequent deploys, many servicesDocker build profiles per language
Ops burdenSmall platform teamExisting NGINX skills → Lua/njs; else containers
Hosting costAlways-on vs scale-to-zeroDerived from memory + CPU under load (production)

6. Decision matrix

The diagram below is the qualitative map we use in reviews — illustrative leaders, not a substitute for running the harness on your kit.

Workload vs criteria decision matrix — winner varies by row

Read it row-first: pick your workload shape, then weight columns. If two criteria conflict (e.g. best RPS vs lowest LOC), that tension is the ADR discussion worth having.

7. Case patterns (example labelling)

The following maps harness test families to architectural choices. Leaders on your machine appear on the dashboard after a run — do not treat this section as fixed scores.

7.1 API latency-sensitive (Tests 1–2, 5–7)

JSON APIs and routing-heavy handlers mirror Tests 2, 5, and 7. Compiled async runtimes (Rust Actix, Go) typically lead on throughput and tail latency in this class of synthetic HTTP benchmarks; Bun often sits close on JSON-heavy paths with JS ergonomics. Java (Javalin) and Kotlin (Ktor) give JVM teams a fair read against those leaders on the same routes — useful when the question is “stay on the JVM with a lighter stack” versus “rewrite in Go/Rust.” Python FastAPI trades raw RPS for development speed — the dashboard verdict calls this out explicitly.

7.2 CPU-bound micro-work (Test 3)

Fibonacci(30) isolates CPU without I/O. Expect Rust and Go to shine; interpreted stacks pay overhead; JVM JIT can look stronger after warmup than a cold 10s window implies — extend duration if that is your real profile. If your real service is I/O bound, do not over-weight this row — it is a stress test for compute-heavy middleware, not typical CRUD.

7.3 Edge transform (Tests 6–7, NGINX variants)

Subrequest and routing tests are where OpenResty Lua and NGINX njs belong: zero extra hop, shared worker memory, ops teams already manage NGINX. The harness’s verdict recommends Go/Rust for core chat/queue backends and Lua/njs at the edge — a sensible split many enterprises already run informally.

7.4 Batch ETL and data pipeline

The HTTP harness does not emulate Spark or warehouse loads. For batch, teams usually prioritise Python ecosystem and orchestration (Airflow, Dagster) or Go workers for throughput. Use Polyglot Benchmarks for the API surfaces and control planes those jobs expose, not for the batch engine itself.

7.5 Quick internal tool

Internal admin APIs with low QPS and high change rate: Python or Bun/Node often win on velocity and hiring. Run Test 2 (JSON) and Test 5 (inspection) to ensure overhead is acceptable; if p99 spikes under 100 connections, reconsider before promoting to customer-facing tiers.

7.6 JVM estate (Java & Kotlin)

Many enterprises already run Java or Kotlin for shared libraries, compliance tooling, and hiring depth. The harness’s java-server (Javalin on Jetty, port 8088) and kotlin-server (Ktor on Netty, port 8089) implement the same seven endpoints as Go and Rust, so you can quantify whether a lighter JVM HTTP stack is “good enough” for a given SLO before a rewrite. Prefer Kotlin when coroutine-style concurrency and Kotlin-first teams matter; prefer Java when the surrounding estate and library graph are already Java-centric. Use the live dashboard rows — do not assume Spring Boot numbers equal Javalin/Ktor numbers.

8. Workflow diagram

Polyglot benchmarks workflow swim lanes

The reproducible loop: specify the workload → run the Compose harness → publish results to the Fictionally dashboard (or your internal clone) → record an ADR with config metadata → re-run when runtimes or hardware change.

9. How to run your own comparison

  1. Clone: git clone https://github.com/bwalia/workflow-examples.git && cd workflow-examples/benchmarks
  2. Start stack: docker compose up --build — builds all language images, starts dashboard on port 8083, runs bench automatically.
  3. Watch: open http://localhost:8083 (or the public site when a hosted run is active).
  4. Extend: add a folder myruntime/, mirror endpoint paths, register a service in docker-compose.yml, append the server to SERVERS in bench.sh.
  5. Customise load: edit DURATION, THREADS, CONNECTIONS at the top of bench.sh — document changes in your ADR.
  6. Add production-shaped tests: e.g. auth middleware, ORM query, 50KB payload — keep parity across languages.

For CI, run Compose in a nightly workflow, archive results.json as an artifact, and fail only on regression thresholds you define (e.g. p99 +20% week over week on Test 2).

10. Anti-patterns

  • Picking the winner of Test 1 only — plain text favours minimal stacks; it ignores JSON, CPU, and routing pain.
  • Ignoring team skills — Rust in production without mentors is expensive in incident time.
  • Ignoring hosting cost — 2× RPS is useless if memory per pod doubles your bill.
  • Mandating one language org-wide — destroys legitimate edge vs core splits.
  • Replacing production profiling — synthetic HTTP ≠ your ORM, cache, or regional latency.
  • Comparing unlike hardware — laptop Docker ≠ bare metal ≠ K8s limits; note the class in the ADR.

11. Benefits for engineering leadership

  • ARB packs — export dashboard screenshots + results.json + Compose hash.
  • Vendor-neutral evidence — no sales deck from a single cloud or framework vendor.
  • Onboarding clarity — new hires see *why* service A is Go and service B is Python.
  • Risk reduction — pilot the runner-up in a shadow service before rewrites.
  • FinOps conversations — link tail latency to autoscaling and memory headroom.
  • Platform roadmap — justify NGINX skill investment vs another K8s microservice.

12. Limitations

  • Synthetic workloads — seven HTTP tests cannot represent Kafka consumers, GPU jobs, or complex ORM graphs.
  • Docker networking — adds overhead; absolute numbers differ from bare metal.
  • Single machine class — hosted results reflect whatever hardware Fictionally uses; your numbers will differ.
  • No persistence layer — database and cache effects are absent by design.
  • Short run duration — 10s per test may not expose GC pauses or warmup cliffs; extend for stress campaigns.

Keep continuous profiling (eBPF, APM, load tests against staging) as the source of truth for production. Polyglot Benchmarks narrows the language and framework debate with reproducible baselines.

13. Conclusion

Default-stack bias is comfortable; it is also how teams ship the wrong runtime for the job. Polyglot Benchmarks and the workflow-examples harness turn “which language wins?” into “which language wins for this workload row?” — with charts your ARB can cite.

Fork the repo, add the endpoints that look like your hot paths, run Compose, and attach the results to the next architecture decision. The companion blog post is the five-minute version for sharing; this article is the reference.

Published by Workstation (workstation.co.uk). Benchmark dashboard hosted at polyglot-benchmarks.fictionally.org in the Fictionally examples ecosystem.


SEO snapshot for this article

  • SEO title: Polyglot Benchmarks: Right Tool for the Job
  • Meta description: Compare njs, Lua, Python, Go, Rust, Bun, Java, and Kotlin on the same HTTP workloads. Reproducible harness, live dashboard, decision matrix for architects.
  • Primary keywords: polyglot benchmarks, language comparison, architecture decisions, workflow examples, performance benchmark, Rust vs Go, Java vs Kotlin, FastAPI, Javalin, Ktor
  • Twitter / X (under 280 chars): Polyglot Benchmarks: same 7 HTTP tests across njs, Lua, Python, Go, Rust, Bun, Java, Kotlin — live dashboard + workflow-examples harness. Not one winner; a decision framework. #Rust #GoLang #Java #Kotlin #Bunjs #polyglot
  • LinkedIn post: We published a deep dive on Polyglot Benchmarks — how to stop picking one org-wide stack from habit and start matching runtimes to workloads. Eight languages (including Java/Javalin and Kotlin/Ktor), seven comparable tests, Docker Compose + wrk, live results at polyglot-benchmarks.fictionally.org, source at github.com/bwalia/workflow-examples/tree/main/benchmarks. Includes decision matrix, anti-patterns, and ADR guidance. From Workstation engineering. #Rust #GoLang #Java #Kotlin #Bunjs #Lua #Python #njs #FastAPI #Javalin #Ktor #OpenResty #polyglot #benchmarks
Partilhar este artigo

Mais sobre Technology

Portáteis para programadores de IA: correr LLM localmente em Linux com GPU de 16 GB e 24 GB (guia de 2026)

Portáteis para programadores de IA: correr LLM localmente em Linux com GPU de 16 GB e 24 GB (guia de 2026)

O que cabe numa RTX 5080 ou RTX 5090 Laptop GPU, as contas da memória, os modelos abertos que vale a pena correr, a configuração do Ubuntu 26.04 com a stack NVIDIA, Ollama, llama.cpp e vLLM, assistentes de programação, fine-tuning LoRA, segurança e quando passar o trabalho para um servidor

Ler mais
Testar sistemas de ML e LLM que não pode provar corretos: um kit de evidências em Python

Testar sistemas de ML e LLM que não pode provar corretos: um kit de evidências em Python

Evidências em vez de provas, em cerca de 400 linhas de Python com resultados reais: métricas por segmento com intervalos bootstrap e um contrato de aprovação/reprovação, testes de propriedades e metamórficos com Hypothesis, calibração e conformal prediction, contratos Pydantic e avaliações de regressão para saídas de LLM, verificações de drift, um gate de CI e a verificação exata de uma pequena rede neuronal

Ler mais
TorchCurves na prática: curvas B-spline e de Legendre aprendíveis em PyTorch

TorchCurves na prática: curvas B-spline e de Legendre aprendíveis em PyTorch

Instalar o torchcurves, ajustar e dimensionar uma curva, escolher B-spline ou Legendre e o mapa de entrada, construir uma curva de calibração monótona e um modelo aditivo sobre dados tabulares, comparar com SciPy, scikit-learn, uma KAN e uma MLP, exportar os coeficientes para JSON, testar e executar em produção, com resultados reais

Ler mais