Daniel Lemire's blog

Science and Technology links (June 7th 2019)

, 1 min read

There is a new drug reaching phase-3 clinical trials (the last phase) for knee osteoarthritis. It seems to be able to regrow cartilage.- Bank of America analysts predict that human lifespan will soon reach 100 years old. If that sounds crazy, consider what demographers have been telling us for…

Nearly Divisionless Random Integer Generation On Various Systems

, 2 min read

It is common in software to need random integers within a range of values. For example, you may need to pick an object at random in an array. Random shuffling algorithms require such random integers. Typically, you generate integers uniformly at random over the full range (say a 64-bit integer in…

Science and Technology links (June 1st 2019)

, 1 min read

The DeepMind engineers built an artificial intelligence (a software program) that can learn to play 3D shooter games at super-human levels. Researchers have found a way to grow large quantities of cells that can generate blood; it works for mice. Europe passed a law to protect privacy online…

Science and Technology links (May 25th 2019)

, 3 min read

Oculus released the Quest, its latest VR goggles. It requires no wiring, no PC. It supports six degrees of freedom, so it is “true VR”. They cost less than $600. The reviews are critical. The goggles still weight too much for long term use and the software is much too limited. I have ordered a…

Measuring the system clock frequency using loops (Intel and ARM)

, 3 min read

In my previous post, Bitset decoding on Apple’s A12, I showed that Apple’s latest ARM-based processor can decode set bits out of a stream of words using 3 cycles per set bit. This compares favourably to Intel processors since I never could get one of them to do better than 3.5 cycles per set…

Science and Technology links (May 18th 2019)

, 1 min read

Though depression has genetic components, the previous studies that identified “depression genes” are probably all bogus. They are the results of poorly conducted research, using underpowered studies to reach untenable conclusions. Many species of salmons die shortly after procreation, a bit…

Building better software with better tools: sanitizers versus valgrind

, 4 min read

We often have to write code using permissive programming languages like C and C++. They tend to generate hard-to-debug problems that can crash your applications. Thankfully, many compilers offer “sanitizers”. I discussed them in my post No more leaks with sanitize flags in gcc and clang. I…

Bitset decoding on Apple´s A12

, 3 min read

In my post Really fast bitset decoding for “average” densities, I reported on our work accelerating the decoding of bitsets. E.g., given a 64-bit register, you want to find the location of every 1-bit. So given 0b110011, you would want to get 0, 1, 4, 5. We want to do this operation with many…

Setting up a ROCKPro64 (powerful single-card computer)

, 4 min read

A few months ago, I ordered ROCKPro64. If you are familiar with the Raspberry Pi, then it is a bit of the same… an inexpensive computer that comes in the form of a single card. The ROCKPro64 differs from the Raspberry Pi in that it is much closer in power to a normal PC. You make a decent laptop…

Science and Technology links (May 11th 2019)

, 1 min read

Bone marrow transplanted from young mice to very old (almost dying) mice extended the life of the old mice by 30%. The authors conclude that bone-marrow transplantation affects the intrinsic aging mechanism. Artery calcification is an easily diagnosed condition which predicts cardiovascular…

Almost picking N distinct numbers at random

, 3 min read

In Picking N distinct numbers at random: how to do it fast?, I describe how to quickly pick N distinct integer values at random from a range of integer values. It comes down to using either bitset/bitmap or a hash set. The bitset approach is very fast when you need to pick many integer values out…

Science and Technology links (May 4th 2019)

, 2 min read

It is often believed that colleges help class mobility… if you were born poor, college can help your rise up. So is there more class mobility when more people go to college? Maybe not: (…) researchers have characterized a college degree as a great equalizer leveling the playing field, and…

Really fast bitset decoding for “average” densities

, 3 min read

Suppose I give you a word and you need to determine the location of the 1-bits. For example, given the word 0b100011001, you would like to get 0,3,4,8. You could check the value of each bit, but that would take too long. A better approach is use the fact that modern processors have fast…

Science and Technology links (April 27th 2019)

, 1 min read

Women who use oral contraceptives have a harder time recognizing emotions of others. Worldwide, livestock has ten times the mass of wild animals and nearly twice the mass of human beings. Fishes have more than ten times the mass of human beings. Using software, we can map brain activity to speech…

Speeding up a random-access function?

, 2 min read

A common problem in software performance is that you are essentially limited by memory access. Let us consider such a function where you write at random locations in a big array. for ( i = 0; i < N; i++) { // hash is a randomized hash function bigarray[hash(i)] = i; } This is a good…

The shopper´s dilemma: wait for new technology or buy now?

, 1 min read

Technology is accelerating. It took less than a decade for smartphone to go from 1% of the population to almost everyone. Television took longer. The phone even longer. Anyone who has been in the market for a technology product knows about what I call the “shopper’s dilemma”. Should you buy…

Science and Technology links (April 20th 2019)

, 2 min read

Early-career setback cause a performance improvement among those who persevere. This is related to the observation that immigrants are four times more likely to become millionaires. In biology, that is called hormesis: by challenging your muscles, you get stronger; by exposing yourself to some…