Archive for January 22, 2020

Wednesday, January 22, 2020

The Hunt for the Fastest Zero

Daniel Lemire (via Raffaele Fragapane, Hacker News):

Typically, to fill an array with some value, C++ programmers invoke the std::fill. We might assume that for a task as simple as filling an array with zeroes, the C++ standard library would provide the absolute best performance. However, with GNU GCC compilers, that is not the case.

The following line of C++ code gets compiled as a loop that fills each individual byte with zeroes when applying the conventional -O2 optimization flag.

std::fill(p, p + n, 0);

When the array is large, it can become inefficient compared to a highly efficient implementation like the C function like memset.

memset(p, 0, n);

Zeroing memory can actually become a bottleneck.

Travis Downs (Hacker News):

Now we see how the memset appears. It is called explicitly by the second implementation shown above, selected by enable_if when the SFINAE condition __is_byte<_Tp> is true. Note, however, that unlike the general function, this variant has a single template argument: template<typename _Tp>, and the function signature is:

__fill_a(_Tp* __first, _Tp* __last, const_Tp& __c)

Hence, it will only be considered when the __first and __last pointers which delimit the range have the exact same type as the value being filled. When when you write std::fill(p, p + n, 0) where p is char *, you rely on template type deduction for the parameters, which ends up deducing char * and int for the iterator type and value-to-fill type, because 0 is an integer constant.

Every Google Result Now Looks Like an Ad

Craig Mod (via Hacker News):

There’s something strange about the recent design change to google search results, favicons and extra header text: they all look like ads, which is perhaps the point?

Ginny Marvin:

In 2007, Google changed the long-standing shaded background indicating the ads section of the page from blue to yellow. In 2008, it then briefly tried a green background before reverting back to yellow. Google continued to test variations of background colors including bright blue and a light violet. In 2010, violet officially replaced the yellow, but only lasted about a year before yellow reappeared in 2011. In 2013, Google tweaked the yellow to a paler shade, which would close out the era of background shading.

At the end of 2013, Google removed the background shading and began testing a yellow ad label next to each text ad. The yellow “Ad” label rolled out globally in 2014 in a much smaller size than first appeared in the initial testing. In 2016, a new green label marked the first time the color of an ad demarcation matched the color of an element in both the ads and organic listings: the display URL. A year later, Google kept the green, but inverted the treatments so that the font was green with a thin green border on a white background. This year’s update to the black label does away with the border altogether. The display URL is now black to match the label.

Here’s a timeline.

Update (2020-01-24): John Gruber:

To say that this design blurs the line between real search results and sponsored items is an understatement.

Natasha Lomas:

Last week, in its own breezy tweet, Google sought to spin the shift as quite the opposite — saying the “new look” presents “site domain names and brand icons prominently, along with a bolded ‘Ad’ label for ads”[…] But Google’s explainer is almost a dark pattern in itself.

Jon Porter:

Early data collected by Digiday suggests that the changes may already be causing people to click on more ads.

Dieter Bohn (via Hacker News):

Today, I still trust Google to not allow business dealings to affect the rankings of its organic results, but how much does that matter if most people can’t visually tell the difference at first glance? And how much does that matter when certain sections of Google, like hotels and flights, do use paid inclusion? And how much does that matter when business dealings very likely do affect the outcome of what you get when you use the next generation of search, the Google Assistant?

And most of all: if Google is willing to visually muddle ads, how long until its users lose trust in the algorithm itself?

Update (2020-02-22): Luke Kling:

I’m old enough to remember when Google was pushing us to not show ads above the fold and focus on good content for the user.

Here is everything above the fold on my latest Google search.

Update (2020-02-26): Damien Petrilli:

Google rolled back their new Ad design my ass.

Literally NO difference between results outside the little “Ad”.

Farewell, Tetris

Juli Clover:

EA is ending support for its Tetris for iOS apps starting on April 21, 2020, the company announced today in app updates to Tetris Premium, Tetris 2011, and Tetris Blitz.


It seems that this post on Reddit explains the situation better; EA had a 15 year license to distribute Tetris games on mobile and that license expires... You guessed it, April 2020.

I’m still irritated that they may kill off existing installs, though. The least they can do is just remove the online components of the game and leave the app playable for those who already have it.


Sonos Will Stop Providing Software Updates for Its Oldest Products in May

Chris Welch:

“Without new software updates, access to services and overall functionality of your sound system will eventually be disrupted, particularly as partners evolve their technology,” Sonos warned in a blog post today. The company says customers can choose to either keep using these products after support ends — they should continue functioning in the near-term — or replace them with a modern Sonos product at a discount.


Sonos is again stressing that these products have been stretched to their absolute limit, noting that many of them — the oldest were introduced in 2006 — predate the iPhone and streaming music services altogether. Sonos has said it’s committed to providing software updates for five years after it last sold a device directly.

Apple tends to be better at stuff like this.

Kirk McElhearn:

It’s worth noting that there is a lot of ire among Sonos users. I follow a Facebook group, and there are a lot of people who bought devices just a year ago that are affected. I also heard from someone on Twitter who had hard-wired a bunch of Sonos stuff in a house, juts five years ago, and it will all be affected.


I have a bunch of Sonos stuff and I use it only with AirPlay, but the company still doesn’t support music libraries over 60,000 tracks (if you point the Sonos app at a folder containing your music files). Yet in practice, this number is much smaller. When I tried – about five years ago – it only managed to see about 40,000 tracks. This is because a lot of my music library is classical, and has a lot of metadata. The library size is limited by the amount of text that can be stored in a database, and with classical music, you can use fewer tracks because the metadata is often larger. Seriously.

See also: Omar.


Update (2020-01-24): Landon Fuller:

My “obsolete” Sonos hardware is only 6 years old. I refuse to pay them more just to stay on a wasteful upgrade treadmill.

Meanwhile, the company that made my 40-year-old smart lighting system is still selling replacement parts and upgrades along-side their modern products.

Sonos (via Hacker News):

First, rest assured that come May, when we end new software updates for our legacy products, they will continue to work as they do today. […] While legacy Sonos products won’t get new software features, we pledge to keep them updated with bug fixes and security patches for as long as possible.


Secondly, we heard you on the issue of legacy products and modern products not being able to coexist in your home. We are working on a way to split your system so that modern products work together and get the latest features, while legacy products work together and remain in their current state.