Hardware Parallelism Accelerates Array Indexing | Generated by AI

Home 2025.11

This 2013 blog post by Yin Wang (王寅) dives into the fundamental reason why direct array indexing (e.g., arr[i]) is constant time O(1), while binary search on a sorted array takes O(log n) time. He breaks it down at the hardware level using a simple circuit analogy, showing that indexing isn’t “magic”—it’s just a massively parallel binary search baked into the computer’s addressing system.

Key Explanation

Why This Matters

Wang argues this reveals how low-level hardware optimizations make high-level operations feel effortless. Binary search is “slow” only because it simulates this circuit sequentially in software; the CPU’s real memory access is the parallel version.

It’s a short, insightful read for anyone curious about CS fundamentals beyond big-O notation.

Why is indexing faster than binary search


Back

x-ai/grok-4-fast

Donate