Skip to content
Carolina Code Conference
Served by SQL (Ash) in 41ms

Polyglot benchmarks

In 2024 we dreamed up the idea of A Polyglot Site for a Polyglot Conference...because it sounded fun. Pointless, but fun.

Now that dream is a reality. If you visit any page on this site that that shows you our Speakers or our [Sponsors](/sponsors], the data is served from an API written in one of these languages.

Scroll past the stats for a details Architecture Overview if you're curious!

Live Traffic Visualizer

Selecting specific languages limits the polyglot APIs used for speakers and sponsors. SQL fallbacks may still occur if necessary.

My Languages: All
Python (http.server)
5447
18
17ms
Python (Django)
5466
18
19ms
JRuby (Sinatra)
5418 21ms
Ruby (Sinatra)
5474
7
21ms
Ada (AWS)
5456
1
22ms
Gleam (mist)
5660 22ms
C (POSIX sockets)
5476 31ms
C++ (cpp-httplib)
5436 34ms
Go (net/http)
5430
4
35ms
Perl (HTTP::Daemon)
5542 35ms
Erlang (Nova)
5480
4
36ms
Elixir (Phoenix)
5453
6
38ms
Perl (Dancer2)
5501 39ms
Kotlin (Ktor)
5482
2
44ms
Groovy (Grails)
5471 46ms
Rust (axum)
5473
3
47ms
Java (httpserver)
5660
9
48ms
Julia (HTTP.jl)
5452
1
49ms
COBOL (GnuCOBOL)
5465
2
50ms
TypeScript (node:http)
5425
11
51ms
PHP (built-in SAPI)
5453
3
63ms
PHP (Laravel)
5470
3
68ms
Pony (Stallion)
5457
2
79ms
Ruby (Rails)
5461
7
83ms
Dart (shelf)
5406 93ms
F# (ASP.NET)
5590
3
94ms
F* (OCaml Unix)
5432
1
94ms

Proudly hosted on Fly.io (2024 Platinum Sponsor).

Architecture Overview

The site uses an Elixir front-end powered by Phoenix, LiveView and Ash connected to a PostgreSQL database with an entirely custom built CMS.

Anywhere that Speakers or Sponsors are displayed on the site, one of our Polyglot APIs are used to serve the request, displayed in the upper right corner of your screen. The Polyglot APIs all connect to a read only database connection via pgbouncer, accessing the Speaker and Sponsor data via versioned database views to simplify management across the fleet. If we need to change how data is fed across the APIs, we can update the VIEW rather than modifying each of the APIs.

Telemetry for each API is tracked in ETS (in memory storage for the BEAM VM used by Erlang/Elixir) by tracking the API round trip. New deployments clear the stats. The site is hosted on Fly.io, which will suspend each VM when not active for a few minutes to save costs. The startup time is relatively quick on a new request, but it can affect the benchmarks. In order to ensure rapid response, the next language up in the list is sent an async request following the current page load to keep it warm.

A couple of tweaks have been made to protect the user's browsing experience. First, Elixir will enforce a timeout behind the scenes if the response time for a language is to slow for some reason. This will lead to moving to another language or simply serving the request with SQL as a fallback.

Additionally, every request is made through a Dynamic GenServer with Cachex based on the data being requested and the language used with a 1 second TTL. If you make the exact same request to the exact same language within 1 second, you will be shown a cached result or you will share the result from the request in progress. The language and time stats for the original request will be displayed in the upper right, but the telemetry data for the request will not change.

The initial APIs that were developed were completed with Ruby (Sinatra) and Go (net/http). Following the initial development, a common AGENTS.md file was created and further language were created with a simple /goal Using our previous criteria, create a polyglot API for the site using <LANGUAGE> which included language specific tests, linters, static security checks, dependency security checks, gitleaks checks and compiler checks if needed as part of the precommit hooks.

Later changes were applied with a local script using herdr to start a new session across each language with a specific prompt. Some additional tuning was done on specific languages if a problem was apparent. For example, the JVM cold start problem was observed in this environment so we attempted to let the AI setup CRcC.

You may click on any language to review it's source on Github and we're happy to review PRs if you have suggestions! We aren't ready to open up for new language submissions just yet but we do have an API starter project for you if you are considering one.

Enjoy exploring and please feel free to share your thoughts on any of our socials!