Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

Why BQN Wins

All BQN solutions outperformed everything else in this perf wars video, this file explains the optimizations BQN has which led it there. Comments

Here is a rewritten account of the story based on the provided source material:

The benchmark results demonstrate that CBQN achieves significantly faster performance compared to C++ and Rust when sorting and rotating boolean arrays. The key advantage lies in how CBQN represents booleans as packed bit arrays, using only 1 bit per element instead of 1 byte per boolean value. This allows for a 64x parallelism multiplier during operations, without the need for SIMD instructions.

In particular, the sort+rotate operation on a 1000-element boolean array in CBQN takes only 159ns, whereas similar operations in C++ and Rust take significantly longer (617-668ns). This is because CBQN avoids the overhead of comparing and swapping individual bytes. Instead, it counts the number of 1s using hardware POPC instructions, then fills the sorted array by directly setting 64-bit words.

For the direct solution of sorting a boolean array and then rotating it, CBQN stores the array as a packed 1-byte representation. When sorting, it utilizes a counting sort algorithm that leverages SIMD instructions to build a histogram in parallel. At a size of 1000 booleans, this results in a fast O(n) sorting operation with a small constant factor.

Other approaches in the benchmark, such as sorting the boolean array directly and then rotating, have a higher complexity of O(n log n). CBQN's implementation of the count solution achieves a sorting time of 151ns, which is nearly as fast as a single memcpy operation. The counting step and replication steps are optimized using SIMD instructions and constant replication, minimizing the number of instructions and memory accesses required.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at github.com →

More in Tech

F-RevoCRM CVE-2026-71368: Cross-Site Scripting Targeting Logged-in Users

F-RevoCRM CVE-2026-71368: Cross-Site Scripting Targeting Logged-in Users 1. Basic Information Article Title : Cross-Site Scripting Vulnerability in F-RevoCRM Publisher : JVN Published / Updated Date…

  • Cross-Site Scripting (XSS) vulnerability in F-RevoCRM versions 7.3.0 to 8.0.3
  • Attackers can send crafted URLs to logged-in users, executing arbitrary scripts
  • Update to version 8.0.4 to mitigate risk and protect session information

More from Tuesday 18 August →