Blogs / Personal blogs

Daniel Lemire

lemire.me

Daniel Lemire is a software performance expert. He ranks among the top 2% of scientists globally (Stanford/Elsevier 2025) and is one of GitHub's top 1000 most followed developers.

Popular posts
87
Total points
15,569
HN comments
9,499
Rank
#41 personal

Visit lemire.me → RSS feedOn Hacker News May 2014 – Sep 2026

Software Engineering 47Systems & Performance 40Math & Algorithms 14Hardware & Electronics 14Society, Policy & Culture 12Tech Industry & Business 8

1

You can beat the binary search

We sometimes have to look for a value in a sorted array. The simplest algorithm consists in just going through the values We sometimes have to look for a value in a sorted array. The simplest algorithm consists in just going through the values one by one, until we encounter the value, or exhaust the … Continue reading…

2

Word-Aligned Bloom Filters

Programmers often need to 'filter out' data. Suppose that you are given a database of users where only a small percentage are 'paying customers' (say 5% or less). You can write an SQL query to check whether a given user is indeed a paying customer, but it might require a round trip to your database … Continue reading…

3

Fast UTF-8 validation

One of the most common "data type" in programming is the text string. When programmers think of a string, they imagine that they are dealing with a list or an array of characters. It is often a "good enough" approximation, but reality is more complex. The characters must be encoded into bits in some way. Most ……

4

Simdjson 0.3: Faster JSON parser

Last year (2019), we released the simjson library. It is a C++ library available under a liberal license (Apache) that can parse JSON documents very fast. How fast? We reach and exceed 3 gigabytes per second in many instances. It can also parse millions of small JSON documents per second. The new version is much ……

6

Go generics are not bad

When programming, we often need to write 'generic' functions where the exact data type is not important. For example, you might want to write a simple function that sums up numbers. Go lacked this notion until recently, but it was recently added (as of version 1.18). So I took it out for a spin. In … Continue reading…

10

C23: A Slightly Better C

One of the established and most popular programming languages is the C programming language. It is relatively easy to learn, and highly practical. Maybe surprisingly, the C programming language keeps evolving, slowly and carefully. If you have GCC 13 or LLVM (Clang) 16, you already have a compiler with some of the…

11

Fast base64 encoding and decoding

Computers store data as streams of bits. Binary files like image, audio or video files are allowed to contain just about any sequence of bits. However, we also often use text formats; for example, web pages and emails are required to be text. So how do we send images by email? How do we embed … Continue reading…

14

Cost of a thread in C++ under Linux

Almost all our computers are made of several processing cores. Thus it can be efficient to "parallelize" expensive processing in a multicore manner. That is, instead of using a single core to do all of the work, you divide the work among multiple cores. A standard way to approach this problem is to create threads. ……

15

Hotspot performance engineering fails

Developers often believe that software performance follows a Pareto distribution: 80% of the running time is spent in 20% of the code. Using this model, you can write most of your code without any care for performance and focus on the narrow pieces of code that are performance sensitive. Engineers like Casey Muratori…

17

Parsing JSON faster with Intel AVX-512

Many recent Intel processors benefit from a new family of instructions called AVX-512. These instructions operate over wide registers (up to 512 bits) and follow the Single instruction, multiple data (SIMD) paradigm. These new AVX-512 instructions allow you to break some speed records, such as decoding base64 data at…

19

Parsing integers quickly with AVX-512

If I give a programmer a string such as "9223372036854775808" and I ask them to convert it to an integer, they might do the following in C++: std::string s = .... uint64_t val; auto [ptr, ec] = std::from_chars(s.data(), s.data() + s.size(), val); if (ec != std::errc()) {} // I have an error ! // val … Continue reading…

20

Some useful regular expressions for programmers

In my blog post, My programming setup, I stressed how important regular expressions are to my programming activities. Regular expressions can look intimidating and outright ugly. However, they should not be underestimated. Someone asked for examples of regular expressions that I rely upon. Here a few. It is commonly…

21

The Go Compiler Needs to Be Smarter

One of my favorite languages is the Go language. I love its simplicity. It is popular and useful in a cloud setting. Many popular tools are written in Go, and for good reasons. I gave a talk on Go last year and I was asked for a criticism of Go. I do not mind that … Continue reading The Go compiler needs to be smarter

24

Enforcement by Software

At my university, one of our internal software systems allows a professor to submit a revision to a course. The professor might change the content or the objectives of the course. In a university, professors have extensive freedom regarding course content. As long as you reasonably meet the course objectives, you can…

26

I do not use a debugger (2016)

I learned to program with BASIC back when I was twelve. I would write elaborate programs and run them. Invariably, they would surprise me by failing to do what I expect. I would struggle for a time, but I'd eventually give up and just accept that whatever "bugs" I had created were there to stay. … Continue reading I…

28

The surprising cleverness of modern compilers

I wanted to know how a modern C compiler like clang would process the following C code: #include <stdint.h> int count(uint64_t x) { int v = 0; while(x != 0) { x &= x - 1; v++; } return v; } Can you guess? popcntq %rdi, %rax That is right. A fairly sophisticated C function, … Continue reading The surprising cleverness…