Daniel Lemire

@lemire
495 Followers
111 Following
677 Posts
Computer science professor at the University of Quebec (TELUQ), open-source hacker, and long-time blogger. 👨‍💻
How many branches can your CPU predict?

Modern processors have the ability to execute many instructions per cycle, on a single core. To be able to execute many instructions per cycle in practice, processors predict branches. I have made the point over the years that modern CPUs have an incredible ability to predict branches. It makes benchmarking difficult because if you test … Continue reading How many branches can your CPU predict?

Daniel Lemire's blog
Prefix sums at tens of gigabytes per second with ARM NEON

Suppose that you have a record of your sales per day. You might want to get a running record where, for each day, you are told how many sales you have made since the start of the year. day sales per day running sales 1 10$ 10 $ 2 15$ 25 $ 3 5$ 30 … Continue reading Prefix sums at tens of gigabytes per second with ARM NEON

Daniel Lemire's blog
You can use newline characters in URLs

We locate web content using special addresses called URLs. We are all familiar with addresses like https://google.com. Sometimes, URLs can get long and they can become difficult to read. Thus, we might be tempted to format them like so in HTML using newline and tab characters, like so: <a href="https://lemire.me/blog/2026/02/21/ how-fast-do-browsers-correct-utf-16-strings/">my blog post</a> It will … Continue reading You can use newline characters in URLs

Daniel Lemire's blog
How bad can Python stop-the-world pauses get?

When programming, we need to allocate memory, and then deallocate it. If you program in C, you get used to malloc/free functions. Sadly, this leaves you vulnerable to memory leaks: unrecovered memory. Most popular programming languages today use automated memory management: Java, JavaScript, Python, C#, Go, Swift and so forth. There are essentially two types … Continue reading How bad can Python stop-the-world pauses get?

Daniel Lemire's blog
AI: Igniting the Spark to End Stagnation

Much of the West has been economically stagnant. Countries like Canada have failed to improve their productivity and standard of living as of late. In Canada, there has been no progress in Canadian living standards as measured by per-person GDP over the past five years. It is hard to overstate how anomalous this is: the … Continue reading AI: Igniting the Spark to End Stagnation

Daniel Lemire's blog
Converting floats to strings quickly

When serializing data to JSON, CSV or when logging, we convert numbers to strings. Floating-point numbers are stored in binary, but we need them as decimal strings. The first formally published algorithm is Steele and White's Dragon schemes (specifically Dragin2) in 1990. Since then, faster methods have emerged: Grisu3, Ryū, Schubfach, Grisu-Exact, and Dragonbox. In … Continue reading Converting floats to strings quickly

Daniel Lemire's blog