gitmyhub

highway

C++ ★ 5.6k updated 16h ago

Performance-portable, length-agnostic SIMD with runtime dispatch

Highway is a C++ library from Google that makes it practical to write code that runs faster by processing multiple pieces of data at the same time. Modern processors have special instructions for this kind of parallel processing, but those instructions differ between chip makers and even between generations of the same chip family. Highway provides a common programming interface so that the same application code works across many processor types without needing to be rewritten for each one.

The practical benefit is significant speed gains. The README cites five times less energy use and five to ten times faster execution in some cases, compared to writing straightforward non-parallel code. The library works by letting developers choose at runtime which set of processor instructions to use, so a single compiled program can automatically use the best available option on whatever machine it runs on. It supports seven processor architectures and four compiler families, and requires C++17.

Highway is used in a wide range of real projects including the JPEG XL image codec, Chromium and Firefox web browsers, TensorFlow, NumPy, and Google's own gemma.cpp language model inference library. The README lists dozens of open-source projects across image processing, machine learning, cryptography, video, and data structures that depend on it.

For someone building software where raw performance matters, such as image codecs, audio tools, search systems, or machine learning inference, Highway provides a way to write that performance-critical code once and have it run well across different hardware. It is a low-level library aimed at C++ developers, not a tool with a graphical interface or high-level API. Getting started requires familiarity with C++ and comfort reading processor architecture documentation.