videsnelson

videsnelson

Following up on Making `dns_erlang` fast: binary tricks for the BEAM, there’s our second post in our series on making erldns, an authoritative DNS server, faster: it’s techniques for hot paths that work in any Erlang or Elixir codebase, I really hope you’ll learn a trick or two.

  • Find, don’t count. ets:select_count/2 =/= 0 is the ETS version of length(L) =/= 0 when matching [_ | _] would do. Stopping at the first match cut our name servers’ CPU by a third.
  • One ets:next/2 instead of a match spec got many kinds of answers 1.8x faster. On an ordered_set, one step from a key that sorts just before the name tells you both whether the name exists and whether anything is below it.
  • Give short-lived processes the heap they need. Spawning a process with a well-chosen min_heap_size made a query take less than half the time as it ran to completion without a single GC cycle.

In production, p90 dropped by about 25%, and by about 33% if the query requests DNSSEC.

Questions and feedback welcome! :slight_smile:

Where Next? Top

Trending in Blog Posts Top

bartblast
My first real blog post is up! Got five minutes? Come break some stuff. I put five demos in it, and they’re meant to be played with. Kill...
New
T0ha666
I run a kanban of AI coding agents, and one afternoon the board showed three tasks running while the profile page on the same screen said...
New
danschultzer
I wrote a post on how to implement a feature flag system and A/B testing in an Elixir app with no need for third-party services or librar...
New
videsnelson
Following up on Making `dns_erlang` fast: binary tricks for the BEAM, there’s our second post in our series on making erldns, an authorit...
New
danschultzer
A small quality-of-life improvement to my blog that makes it easier to keep technical posts up to date with a revision history. https://...
New
danschultzer
Wrote a post about how I set up HTML email templates in Phoenix using the template renderer with Gettext and verified routes, CSS inlinin...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews