Daniel Lemire's blog

More fun with fast remainders when the divisor is a constant

, 2 min read

In software, compilers can often optimize away integer divisions, and replace them with cheaper instructions, especially when the divisor is a constant. I recently wrote about some work on faster remainders when the divisor is a constant. I reported that it can be fruitful to compute the remainder…

Science and Technology links (February 16th, 2019)

, 2 min read

In their new book Empty Planet, Bricker and Ibbitson argue that within the next 30 years, Earth’s population will start to rapidly decline. They believe that official population predictions overestimate future populations because they fail to fully take into account accelerating cultural…

My iPad Pro experiment: almost two years later

, 4 min read

Soon after the first iPad Pro came out, I bought one and started using it daily. The experiment is ongoing and I thought it was time to reflect upon it further. Before I begin, I need to clarify my goals. When I started this experiment, some people objected that I could get a hybrid…

Science and Technology links (February 9th, 2019)

, 2 min read

Though deep learning has proven remarkably capable in many tasks like image classification, it is possible that the problems they are solving remarquably well are just simpler than we think: At its core our work shows that [neural networks] use the many weak statistical regularities present in…

Faster remainders when the divisor is a constant: beating compilers and libdivide

, 7 min read

Not all instructions on modern processors cost the same. Additions and subtractions are cheaper than multiplications which are themselves cheaper than divisions. For this reason, compilers frequently replace division instructions by multiplications. Roughly speaking, it works in this manner.…

Science and Technology links (February 3rd, 2019)

, 2 min read

A Canadian startup built around electric taxis failed. One of their core findings is that electric cars must be recharged several times a day, especially during the winter months. Evidently, the need to constantly recharge the cars increases the costs. I think that this need to constantly recharge…

New Web host

, 1 min read

Following my recent blogging problems, the majority advice I received was to move to a different host. My blog is now hosted by SiteGround. Moving my content over was far easier than I anticipated, so far. I am no longer using Cloudflare to cache everything so your queries should hit directly my…

Web caching: what is the right time-to-live for cached pages?

, 2 min read

I have been having performance problems with my blog and this forced me to spend time digging into the issue. Some friends of mine advocate that I should just “pay someone” and they are no doubt right that it would be the economical and strategic choice. Sadly, though I am eager to pay for…

My blog can´t keep up: 500 errors all over

, 3 min read

My blog is relatively minor enterprise. It is strictly non-profit (no ad). I have been posting one or two blog posts a week for about fifteen years. I have been using the same provider in all this time (csoft.net). They charge me about $50 a month. I also subscribe to Cloudflare services, which…

What is the space overhead of Base64 encoding?

, 2 min read

Many Internet formats from email (MIME) to the Web (HTML/CSS/JavaScript) are text-only. If you send an image or executable file by email, it often first gets encoded using base64. The trick behind base64 encoding is that we use 64 different ASCII characters including all letters, upper and lower…

Data scientists need to learn about significant digits

, 2 min read

Suppose that you classify people on income or gender. Your boss asks you about the precision of your model. Which answer do you give? Whatever your software tells you (e.g., 87.14234%) or a number made of a small and fixed number of significant digits (e.g., 87%). The latter is the right answer in…

Rethinking Hamming´s questions

, 2 min read

Richard Hamming is a famous computer scientist. In his talk You and Your Research, Hamming recounts how asked researchers three questions which I paraphrase: What are the important problems of your field? What important problems are you working on? If what you are doing is not important, and if…

Science and Technology links (January 26th, 2019)

, 4 min read

We are training many more doctors (PhDs) than we need, when looking at the number of new faculty positions. In science, this has been true since at least the 1980s. It is not uncommon for even so-so faculty positions to receive dozens of top-notch applicants with PhDs. Yet it is often believed…

Science and Technology links (January 19th, 2019)

, 2 min read

Losing even just a bit of weight can be enough to restore fertility in women. Digital technology does not appear to have a significant negative effect on teenagers, according to an article published by Nature. According to an article published by Nature, woody vegetation cover over sub-Saharan…

Faster intersections between sorted arrays with shotgun

, 2 min read

A common problem within databases and search engines is to compute the intersection between two sorted array. Typically one array is much smaller than the other one. The conventional strategy is the “galloping intersection”. In effect, you go through the values in the small arrays and then do a…

Science and Technology links (January 12th, 2019)

, 1 min read

You can buy a 512GB memory card for $140 from Amazon. We have been told for decades to avoid saturated fats, the kind found in meat, cheese and butter. After an extensive review, Grasgruber et al. conclude: Our results do not support the association between cardiovascular diseases and saturated…

Science and Technology links (January 5th, 2019)

, 2 min read

There are nearly 70,000 centenarians in Japan. China’s population fell by 1.27 million in 2018. Obesity is associated with increased senescent cell burden and neuropsychiatric disorders, including anxiety and depression. Clearing senescent cells could alleviate these symptons. Women who come…

Memory-level parallelism: Intel Skylake versus Intel Cannonlake

, 30 min read

All programmers know about multicore parallelism: your CPU is made of several nearly independent processors (called cores) that can run instructions in parallel. However, our processors are parallel in many different ways. I am interested in a particular form of parallelism called “memory-level…

Important science and technology findings in 2018

, 2 min read

The Gompertz-Makeham law predicts statistically the mortality rate of human beings. The key takeaway is that it is an exponential function. Every few years, the mortality rate of a human being doubles. It is not unique to human beings: most mammals and many other animals have an exponentially…

Science and Technology links (December 29th, 2018)

, 2 min read

Low-dose radiation from A-bombs elongated lifespan and reduced cancer mortality relative to un-irradiated individuals (Sutou, 2018): The US National Academy of Sciences (NAS) presented the linear no-threshold hypothesis (LNT) in 1956, which indicates that the lowest doses of ionizing radiation…