{
  "id": 1606878,
  "title": "Why BQN Wins",
  "url": "https://urgent.news/2026/08/18/why-bqn-wins",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-18T00:57:16.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://github.com/codereport/max-odd-binary/blob/main/WHY_BQN_WINS.md"
  },
  "original_language": "en",
  "account": "Here is a rewritten account of the story based on the provided source material:\n\nThe 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.\n\nIn 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.\n\nFor 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.\n\nOther 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.",
  "summary": "All BQN solutions outperformed everything else in this perf wars video, this file explains the optimizations BQN has which led it there. Comments",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}