acm-header
Sign In

Communications of the ACM

Blogroll


bg-corner

Unsigned comparisons using signed types
From Daniel Lemire's Blog

Unsigned comparisons using signed types

There are two main types of fixed-precision integers in modern software: unsigned and signed. In C++20 and above, the signed integers must use the two’s complement...

Speeding up C++ code with template lambdas
From Daniel Lemire's Blog

Speeding up C++ code with template lambdas

Let us consider a simple C++ function which divides all values in a range of integers: void divide(std::span<int> i, int d) { for (auto& value : i) { value /= d...

An overview of parallel programming (Go edition)
From Daniel Lemire's Blog

An overview of parallel programming (Go edition)

In practice, the software we write runs on several processors. Unfortunately, much of what we take for granted on a single processor becomes false when there are...

How fast can you open 1000 files?
From Daniel Lemire's Blog

How fast can you open 1000 files?

Jarred Sumner, the main author of the Bun JavaScript engine, commented a few days ago on X that opening many files on macOS could be slow due to thread contention...

AVX-512 gotcha: avoid compressing words to memory with AMD Zen 4 processors
From Daniel Lemire's Blog

AVX-512 gotcha: avoid compressing words to memory with AMD Zen 4 processors

The recent AMD processors (Zen 4) provide extensive support for the powerful AVX-512 instructions. AVX-512 (Advanced Vector Extensions 512) is an extension to the...

Thread-safe memory copy
From Daniel Lemire's Blog

Thread-safe memory copy

A common operation in software is the copy of a block of memory. In C/C++, we often call the function memcpy for this purpose. But what happens if, while you are...

Programmer time and the pitfalls of wasteful work
From Daniel Lemire's Blog

Programmer time and the pitfalls of wasteful work

Programmer time is precious. This realization should shape our approach to software development, focusing our efforts on tasks that genuinely contribute to theContinue...

Regular expressions can blow up!
From Daniel Lemire's Blog

Regular expressions can blow up!

Regular expressions, often abbreviated as regex, are a powerful tool for pattern matching within text. For example, the expression \d*\.?\d+ would match a positive...

Checking whether an ARM NEON register is zero
From Daniel Lemire's Blog

Checking whether an ARM NEON register is zero

Your phone probably runs on 64-bit ARM processors. These processors are ubiquitous: they power the Nintendo Switch, they power cloud servers at both Amazon AWSContinue...

JavaScript hashing speed comparison: MD5 versus SHA-256
From Daniel Lemire's Blog

JavaScript hashing speed comparison: MD5 versus SHA-256

Hashing algorithms convert input data into a fixed-size string of characters, known as a hash value or digest. These algorithms are one-way functions, meaning the...

Counting the digits of 64-bit integers
From Daniel Lemire's Blog

Counting the digits of 64-bit integers

Given an integer in software, you may want to know how many decimal digits it needs. For example, the integer 100 requires 3 digits, the integer 9999 requires 4...

How does your URL parser handle Unicode?
From Daniel Lemire's Blog

How does your URL parser handle Unicode?

Most strings today in software are Unicode strings. It means that you can include mathematical symbols, emojis and so forth. There are many different versions of...

Efficient In-Place UTF-16 Unicode Correction with ARM NEON
From Daniel Lemire's Blog

Efficient In-Place UTF-16 Unicode Correction with ARM NEON

Modern-day text in software can be expected to be Unicode. Unicode is stored in two formats: UTF-8 and UTF-16. UTF-16 is an encoding system used by several platforms...

Simpler and faster parsing code with std::views::split
From Daniel Lemire's Blog

Simpler and faster parsing code with std::views::split

Parsing text files is often confusing irrespective of your programming language. It can also be surprising slow. As an example, let us consider the following problem...

Accessing the attributes of a struct in C++ as array elements?
From Daniel Lemire's Blog

Accessing the attributes of a struct in C++ as array elements?

In C++, it might be reasonable to represent a URL using a class or a struct made of several strings, like so: struct basic { std::string protocol; std::string username...

Data structures as jigs for programmers (Go edition)
From Daniel Lemire's Blog

Data structures as jigs for programmers (Go edition)

A data structure in programming is a specific way of organizing and storing data in a computer so that it can be accessed and used efficiently. In woodworking or...

Parsing floats at over a gigabyte per second in C#
From Daniel Lemire's Blog

Parsing floats at over a gigabyte per second in C#

A few years ago, we wrote csFastFloat, a C# library to parse floating-point numbers faster. Given the string “3.1416”, it computes the binary value 3.1416. TheContinue...

Graduate degrees are overrated
From Daniel Lemire's Blog

Graduate degrees are overrated

Though I have many brilliant graduate students, I love working with undergraduate students. And I am not at all sure that you should favor people with graduateContinue...

Having fun with modern C++
From Daniel Lemire's Blog

Having fun with modern C++

Recent versions of the C++ language (C++20 and C++23) may allow you to change drastically how you program in C++. I want to provide some fun examples. Thanks to...

How fast can you parse a CSV file in C#?
From Daniel Lemire's Blog

How fast can you parse a CSV file in C#?

We often store large datasets using comma-separated-value (CSV) files. The format is simple enough, each line of a text file is made of several values separated...
Sign In for Full Access
» Forgot Password? » Create an ACM Web Account