Highway is a C++ library that provides portable SIMD/vector intrinsics with runtime dispatch across multiple CPU architectures.
Highway solves the problem of writing high-performance vector code that works reliably across different processors and instruction sets. SIMD instructions apply the same operation to multiple data items simultaneously, potentially reducing energy usage fivefold and delivering 5-10x speedups. Highway's approach uses carefully-chosen functions that map directly to CPU instructions without requiring extensive compiler transformations, making the resulting code more predictable and robust to compiler changes than autovectorization. The library supports seven architectures including x86 variants (SSE4.2, AVX, AVX-2, AVX-512), ARM NEON, and WebAssembly, allowing the same application code to target various instruction sets including those with scalable vectors whose size is unknown at compile time.
Developers should choose Highway if they need reliable performance gains from SIMD without the fragility of hand-written intrinsics or autovectorization. It suits applications in image processing, compression, video analysis, linear algebra, cryptography, sorting, and random generation. The library requires only C++17 and supports four compiler families. Applications can run on heterogeneous clouds or client devices, selecting the best available instruction set at runtime, or developers can target a single instruction set with no runtime overhead by changing only one line of code. The biggest performance gains come from designing algorithms and data structures for scalable vectors using techniques like batching and structure-of-array layouts, though Highway also provides tools like Gather and MaskedLoad for accelerating legacy data structures.
The project maintains a substantial base of adopters who report real-world issues, with almost all open issues raised by outside users rather than the core team. Maintainers typically respond to new issues and pull requests within hours.