Daniel Lemire's blog

On metadata

, 8 min read

I remember a time, before the Web, when you would look for relevant academic papers by reading large books with tiny fonts that would list all relevant work in a given area published in a given year. Of course, you could have just gone to the shelves and checked the research articles themselves…

Framed in the past

, 3 min read

We can’t predict the future. However, I still read futurologists like Calum Chace, Alvin Toffler, Bruce Sterling, Vernor Vinge, Joël de Rosnay and so forth. A good futurologist won’t even attempt to predict the future for real, but he will offer a new way to think about the present. Indeed,…

My review of Deus Ex: Mankind Divided (video game)

, 3 min read

The Deus Ex series is set in a dystopian futuristic universe. (It reminds me a bit of Japan’s Ghost in the Shell.) The latest game in the series (Deux Ex: Mankind Divided) is set less than 15 years in the future (2029). In this future, many people have artificial organs (eyes, legs, hands) called…

Who is keeping an eye on the tech companies?

, 3 min read

A corporation such as Spotify was founded a few years ago by a 23-year-old man, and it now plays a key role in the music industry. YouTube is now the big-boss of music delivery. Had I predicted these things ten years ago, you would have thought me odd. Kurzweil, the inventor, popularized the notion…

Update to my VR bet with Greg Linden

, 1 min read

I have an ongoing bet with Greg Linden stating that we are going to sell 10 million virtual-reality (VR) units per year by 2019. I have been paying close attention to VR technology and its impact. What have we learned in the last few months? The technology is fantastic. VR headsets work. The…

Intel will add deep-learning instructions to its processors

, 1 min read

Some of the latest Intel processors support the AVX-512 family of vector instructions. These instructions operate on blocks of 512 bits (or 64 bytes). The benefit of such wide instructions is that even without increasing the processor clock speed, systems can still process a lot more data. Most…

A case study in the performance cost of abstraction (C++´s std::shuffle)

, 3 min read

Statisticians and machine-learning experts sometimes need to shuffle data quickly and repeatedly. There is one standard and simple algorithm to shuffle an array, the so-called Fisher-Yates shuffle: for (i=size; i>1; i--) { nextpos = random_numbers_in_range(0,i); swap(storage[i-1],…

Variable-length strings can be expensive

, 2 min read

Much of our software deals with variable-length strings. For example, my name “Daniel” uses six characters whereas my neighbor’s name (“Philippe”) uses 8 characters. “Old” software often shied away from variable-length strings. The Pascal programming language supported fixed-length…

Can Swift code call C code without overhead?

, 4 min read

Swift is the latest hot new language from Apple. It is becoming the standard programming language on Apple systems. I complained in a previous post that Swift 3.0 has only about half of Java’s speed in tests that I care about. That’s not great for high-performance programming. But we do have a…

Sorting already sorted arrays is much faster?

, 1 min read

If you are reading a random textbook on computer science, it is probably going to tell you all about how good sorting algorithms take linearithmic time. To arrive at this result, they count the number of operations. That’s a good model to teach computer science, but working programmers need more…

Swift versus Java : the bitset performance test

, 3 min read

I claimed online that the performance of Apple’s Swift was not yet on par with Java. People asked me to back my claim with numbers. I decided to construct one test based on bitsets. A bitset is a fast data structure to implement sets of integers. Java comes with its own bitset class called…

My thoughts on Swift

, 3 min read

Swift is a new programming language produced by Apple for its iOS devices (primarily the iPhone). It first appeared two years ago and it has been gaining popularity quickly. Before Swift, Apple programmers were “stuck” with Objective-C. Objective-C is old and hardly ever used outside the Apple…

The rise of dark circuits

, 6 min read

The latest iPhone 7 from Apple has more computing peak power than most laptops. Apple pulled this off using a technology called ARM big.LITTLE where half of the processor is only used when high performance is needed, otherwise it remains idle. That’s hardly the sole example of a processor with…

The memory usage of STL containers can be surprising

, 2 min read

C++ remains one of the most popular languages today. One of the benefits of C++ is the built-in STL containers offering the standard data structures like vector, list, map, set. They are clean, well tested and well documented. If all you do is program in C++ all day, you might take STL for granted,…

Starting high school in 2016

, 2 min read

My oldest boy started high school this year. He goes to an accessible private school nearby. We went to a parent’s meeting last night. Personal electronics is banned from the school. So no smartphone. No portable game console. Last year, the principal hinted that the ban was unenforceable. This…

The new C standards are worth it

, 1 min read

The C language is one of the oldest among the popular languages in use today. C is a conservative language. The good news is that the language is aging well and it has been rejuvenated by the latest standards. The C99 and C11 standards bring many niceties… Fixed-length types such as uint32_t for…

Function signature: how do you order parameters?

, 2 min read

Most programming languages force you to order your function parameters. Getting them wrong might break your code. What is the most natural way to order the parameters? A language should aim to be generally consistent to minimize surprises. For example, in most languages, to copy the value of the…

Are there too many people?

, 2 min read

Without immigration, most developed countries would face massive depopulation. In fact, half the population of the Earth lives in countries with sub-replacement fertility. The threshold for a sustained population is a fertility rate of 2.1. Taiwan South Korean and Singapore are at 1.2, Japan and…

The rate-of-living theory is wrong

, 4 min read

The rate-of-living theory is popular on the Internet. The intuition is that all animals are born with some “budget” that they burn out over time according to their rate of energy expenditure. A proxy for how much energy you spend is your heart rate. Anyhow. You are a candle. The harder you…