Daniel Lemire's blog

Science and Technology links (August 9th 2020)

, 2 min read

The BBC reports that diversity and anti-bias training is of little use and may even be counterproductive if the goal is reduce biases: “The effect of bias training is very weak if you look at the long run,” says Kalev. “A company is better off doing nothing than mandatory diversity…

Performance tip: constructing many non-trivial objects is slow

, 3 min read

I started programming professionally when Java came out and right about when C++ was the “hot new thing”. Following the then-current fashion, I looked down at C and Pascal programming. I fully embraced object-oriented programming. Everything had to be represented as an object. It was the right…

Science and Technology links (August 1st 2020)

, 1 min read

In Japan, a large dam is being constructed almost entirely by robots. Naked mole rats are mammals that do not age in the sense that their fitness and mortality follows a flat curve, and not a Gompertz curve. Senescent cells are large dysfunctional cells that we tend to accumulate as we age.…

Science and Technology links (July 25th 2020)

, 1 min read

I was taught that human beings only arrived to America recently (15,000 years ago). It turns out that it is wrong. There were human beings in America 30,000 years ago. (Source: Nature) Quantum tuneling is not instantaneous contrary to what you were told. The U.S. Air Force is planning to…

Avoid character-by-character processing when performance matters

, 2 min read

When processing strings, it is tempting to view them as arrays of characters (or bytes) and to process them as such. Suppose that you would like to determine whether a string is ASCII. In ASCII, every character must be a byte value smaller than 128. A fine C++17 approach to check that a string is…

Downloading files faster by tweaking headers

, 2 min read

I was given a puzzle recently. Someone was parsing JSON files downloaded from the network from a bioinformatics URI. One JSON library was twice as fast at the other one. Unless you are on a private high-speed network, the time required to parse a file will always be small compared to the time…

The cost of runtime dispatch

, 2 min read

For high-performance software, it is sometimes needed to use different functions, depending on what the hardware supports. You might write different functions, some functions for advanced processors, others for legacy processors. When you compile the code, the compiler does not yet know which code…

Science is the belief in the ignorance of experts

, 8 min read

Science is the belief in the ignorance of experts said Richard Feynman. Feynman had a Nobel prize in physics. He was a remarquable educator: his lecture notes are still popular. He foresaw nanotechnology and quantum computing. He is credited with identifying the cause of the Space Shuttle…

Science and Technology links (July 11th 2020)

, 1 min read

Some upcoming Mercedes cars will have augmented reality head-up displays. Intel’s new standard for high-speed cables (thunderbolt) supports 3 GB/s bandwidth. (This is very fast: internal disks usually cannot sustain such speeds.) Enrichment activities have no cognitive benefits in kids. Aspirin…

GNU GCC on x86 does not round floating-point divisions to the nearest value

, 4 min read

I know that floating-point arithmetic is a bit crazy on modern computers. For example, floating-point numbers are not associative: 0.1+(0.2+0.3) == 0.599999999999999978 (0.1+0.2)+0.3 == 0.600000000000000089 But, at least, this is fairly consistent in my experience. You should simply not assume…

Science and Technology links (June 20th 2020)

, 2 min read

UCLA researchers have achieved widespread rejuvenation in old mice through blood plasma dilution, a relatively simple process. (…) these results establish broad tissues rejuvenation by a single replacement of old blood plasma with physiologic fluid: muscle repair was improved, fibrosis was…

Computational overhead due to Docker under macOS

, 2 min read

For my programming work, I tend to assume that I have a Linux environnement. That is true whether I am under Windows, under macOS or under a genuine Linux. How do I emulate Linux wherever I go? I use docker containers. Effectively, the docker container gives me a small subsystem where everything is…

Reusing a thread in C++ for better performance

, 2 min read

In a previous post, I measured the time necessary to start a thread, execute a small job and return. auto mythread = std::thread([] { counter++; }); mythread.join(); The answer is thousands of nanoseconds. Importantly, that is the time as measured by the main thread. That is, sending the query,…

Science and Technology links (June 6th 2020)

, 3 min read

A small number of people are responsible for a disproportionate number of inventions and innovations. Why are these people different? Using neuroimaging techniques, scientists find that superior individuals may not have distinct processes per se, but rather they use common processes differently,…

How Innovation Works (book review)

, 3 min read

I read How Innovation Works by Matt Ridley in a few hours. It is a delicious book. Ridley distinguishes invention from innovation. The inventor creates something new, the innovator applies the novelty to change the world. Jeff Bezos innovated with his Amazon site, but he may not be much of an…

The Go compiler needs to be smarter

, 5 min read

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 Go lacks exceptions or generics.…

Science and Technology links (May 30th 2020)

, 2 min read

We might soon be able to buy memory cards with speeds nearing 4 GB/s. For comparison, an expensive and recent macBook currently has a disk with a 2 GB/s bandwidth. The PlayStation 5 should have a 5 GB/s bandwith. Human industry has boosted the amount of CO2 in the atmosphere. This has two…