Boing Boing / Google Gemini
Binary search is the page-flipping trick everyone learns in their first programming class: to find a word in a sorted list, look at the middle, decide whether your target is in the top or bottom half, and repeat. It has been considered close to optimal since the 1940s. Computer scientist Daniel Lemire, who specializes in fast algorithms, just published benchmarks showing he can beat it by more than 2x on both Apple and Intel chips.
The trick is that modern processors are nothing like the imaginary computers that textbook algorithms were designed for. Today's chips ship with SIMD instructions that compare eight 16-bit values against a target in a single operation and can fetch several values from memory at once instead of waiting in line. Binary search, which inches forward one comparison at a time, leaves all that hardware sitting idle.
Lemire's algorithm, which he calls SIMD Quad, splits the array into 16-element blocks, then narrows down to the correct block by jumping through quarters rather than halves. Once it lands on a block, SIMD checks all 16 entries at once. More instructions overall, but the chip runs them in parallel, so the wall-clock time drops.
He ran 10 million queries for each array size from 2 to 4,096 elements on an Apple M4 and an Intel Emerald Rapids server. SIMD Quad won every single comparison. On Intel with a warm cache, it finished in less than half the time. On Apple with a cold cache, same result. "Standard algorithms," Lemire writes, "were often not designed for computers that have so much parallelism." His source code is on the blog.
Previously:
This 8×8 display uses vacuum and silicone instead of LEDs
A YouTuber who goes by soiboi soft built an 8×8 pixel display that uses pneumatics and stretchy silicone instead of LEDs. The effect is mesmerizing and appealing. The orange rubber… READ THE REST
Kindle update disables favorite slow reader trick
Kindle users have long turned off wifi to extend their ebook library loans. A new update is closing the loophole. For slow readers and folks who borrow way too many… READ THE REST
North Korea's operating system watermarks every file you touch
North Korea's Red Star Linux OS ships with a modified Firefox called Naenara ("Our country") and lets users browse Kwangmyong, the country's isolated national intranet. It also comes with an office suite,… READ THE REST
This $40 AI hub lets GPT, Claude, Gemini, and more duke it out
Disclosure: Boing Boing earns a commission on purchases made through links in this post. TL;DR: AskAnyModel AI lets you compare responses from up to six AI models side by side, with… READ THE REST
Pay $79.99 Once and Put ChatGPT, Claude, and Gemini Under One Roof
Disclosure: Boing Boing earns a commission on purchases made through links in this post. TL;DR: Get lifetime access to 1min.AI, a multi-model AI workspace built for writing, images, documents, PDFs, audio,… READ THE REST
Microsoft's best design software is only $40 for life through September 1
Disclosure: Boing Boing earns a commission on purchases made through links in this post. TL;DR: Microsoft Visio Professional 2024 is a full diagramming program for Windows, and a lifetime license is… READ THE REST