HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
google
highway
C++2020–2026
google / highway

highway

Performance-portable, length-agnostic SIMD with runtime dispatch

37Distinct people
107Mentions
1Explicit recommenders
6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Performance-portable, length-agnostic SIMD with runtime dispatch

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

> but that algorithm requires costly preprocessing of the set to be matched. For string functions, input strings are usually very short > the advantage of longer vectors…

janwas used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 2:59:58 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year107 dated mentions

Observed mentions: 2020-08-04 18:38:08 UTC to 2026-09-25 20:11:25 UTC.

01020302020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 9 mentions; 1 submissions, 8 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 24 mentions; 1 submissions, 23 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 30 mentions; 1 submissions, 29 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 18 mentions; 2 submissions, 16 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 13 mentions; 0 submissions, 13 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 12 mentions; 2 submissions, 10 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC918
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC24123
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC30129
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC18216
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC13013
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC12210

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Efficient and performance-portable vector software Highway is a C++ library that provides portable SIMD/vector intrinsics. Documentation Previously licensed under Apache 2, now dual-licensed as Apache 2 / BSD-3. Why We are passionate about high-performance software. We see major untapped potential in CPUs (servers, mobile, desktops). Highway is for engineers who want to reliably and economically push the boundaries of what is possible in software. How CPUs provide SIMD/vector instructions that apply the same operation to multiple data items. This can reduce energy usage e.g. fivefold because fewer instructions are executed. We also often see 5-10x speedups. Highway makes SIMD/vector programming practical and workable according to these guiding principles: Does what you expect: Highway is a C++ library with carefully-chosen functions that map well to CPU instructions without extensive compiler transformations. The resulting code is more predictable and robust to code changes/compiler updates than autovectorization. Works on widely-used platforms: Highway supports seven architectures; the same application code can target various instruction sets, including those with 'scalable' vectors (size unknown at compile time). Highway only requires C++17 (language features, not necessarily the library) and supports four families of compilers. If you want to use Highway on other platforms, please raise an issue. Flexible to deploy: Applications using Highway can run on heterogeneous clouds or client devices, choosing the best available instruction set at runtime. Alternatively, developers may choose to target a single instruction set without any runtime overhead. In both cases, the application code is the same except for swapping HWY_STATIC_DISPATCH with HWY_DYNAMIC_DISPATCH plus one line of code. See also @kfjahnke's introduction to dispatching. Suitable for a variety of domains: Highway provides an extensive set of operations, used for image processing (floating-point), compression, video analysis, linear algebra, cryptography, sorting and random generation. We recognise that new use-cases may require additional ops and are happy to add them where it makes sense (e.g. no performance cliffs on some architectures). If you would like to discuss, please file an issue. Rewards data-parallel design: Highway provides tools such as Gather, MaskedLoad, and FixedTag to enable speedups for legacy data structures. However, the biggest gains are unlocked by designing algorithms and data structures for scalable vectors. Helpful techniques include batching, structure-of-array layouts, and aligned/padded allocations. We recommend these resources for getting started: SIMD programming with Highway talk SIMD for C++ Developers Algorithms for Modern Hardware Optimizing software in C++ Improving performance with SIMD intrinsics in three use cases Examples Online demos using Compiler Explorer: multiple targets with dynamic dispatch (more complicated, but flexible and uses best available SIMD) single target using -m flags (simpler, but requires/only uses the instruction set enabled by compiler flags) We have prepared several tutorial-like examples in hwy/examples; see the README.md there for more information. Basics: sum_array_advanced.cc: 4x unrolling and remainder handling. dot_product_unroll.cc: similar to sum_array_advanced, plus reduction. matrix_transpose_scatter_gather: shows/compares Scatter and Gather. Infrastructure: benchmark.cc: dot product with remainder-free loops and benchmarking. profiler_example: shows how to use the our built-in profiler for measuring the time cost of annotated zones. skeleton*: a complete example of a module with runtime dispatch. Challenges: masks_and_logic.cc: visualizes masks/comparisons with ASCII art. ctf_aes.cc: capture the flag, brute-force AES password guessing. We observe that Highway is referenced in the following open source projects, found via sourcegraph.com. Most are GitHub repositories. If you would like to add your project or link to it directly, feel free to raise an issue or contact us via the below email. Audio: Zimtohrli perceptual metric Browsers: Chromium (+Vivaldi), Firefox (+floorp / foxhound / librewolf / Waterfox) Computational biology: RNA analysis, long-sequence preprocessing Computer graphics: ghostty-org/ghostty, Sparse voxel renderer, tgfx 2D Graphics library Cryptography: google/distributed_point_functions, google/shell-encryption Data structures: bkille/BitLib Image codecs: eustas/2im, Grok JPEG 2000, JPEG XL, JPEGenc, Jpegli, libaom, OpenHTJ2K Image processing: awxkee/aire, cloudinary/ssimulacra2, libvips, m-ab-s/media-autobuild_suite, Image viewers: AlienCowEatCake/ImageViewer, diffractor/diffractor, Lux panorama/image viewer, mirillis/jpegxl-wic Information retrieval: iresearch database index, michaeljclark/zvec, nebula interactive analytics / OLAP, ScaNN Scalable Nearest Neighbors, Machine learning: array2d/deepx, gemma.cpp, Tensorflow, Numpy, zpye/SimpleInfer Programming languages: AOT-compiled python, oven-sh/bun, V8/V8, yinqiwen/rapidudf Robotics: MIT Model-Based Design and Verification Vector search: 1yefuwang1/vectorlite, vespa-engine/vespa Other Evaluation of C++ SIMD Libraries: "Highway excelled with a strong performance across multiple SIMD extensions [..]. Thus, Highway may currently be the most suitable SIMD library for many software projects." zimt: C++11 template library to process n-dimensional arrays with multi-threaded SIMD code vectorized Quicksort (paper) Highway can also be installed via a package manager or from a repository: Click to expand BSD repositories DragonFlyBSD FreeBSD GhostBSD MidnightBSD Click to expand cross platform package repositories conan-io conda-forge EasyBuild Homebrew microsoft/vcpkg spack xmake-io/xmake-repo Click to expand linux package repositories Obtained from repology Click to expand Windows package repositories fd00/yacp MSYS2 Click to expand other operating
Read the full README on GitHub

What Hacker News says

9 sources
Thanks for sharing the examples! Looks like broadcast and replicating one element, which works if we know there are only 4 elements. > I was doing something like that, saving a few instructions Oh, nice one. > I think ARM is good enough for most applications, except very small niches (very low power, very price-sensitive, mostly embedded). Are you talking about the ARM arch vs Risc-V? That may be, but ARM is also getting SVE, and adding yet another #if for that is going to be expensive. > Yeah, but other things can’t. For one, ARM has 8-byte SIMD vectors. hm, Highway does support half vectors which map nicely to the non-q instructions. We also support 8-bit StoreInterleaved3 which is implemented similar to yours (more instructions but fewer constants): https://github.com/google/highway/blob/master/hwy/ops/x86_12... In my experience, integ
Read the rest
er mul are the hardest to bridge, but at least for dot products even that is feasible.
In AVX512/VBMI2: A Programmer’s Perspective
> _mm256_blend_pd is very fast instruction, a single cycle of latency. The highway’s emulation is going to be way more expensive. Actually it uses exactly the same instruction :) https://github.com/google/highway/blob/master/hwy/ops/x86_25... Thanks for sharing the list! Out of curiosity, can you expand on what _mm256_permute4x64_pd is used for? > _mm_addsub_ps (that one is vertical but still missing from highway) Indeed, we have not needed complex-valued functions yet. AFAIK NEON does not have such an instruction but it could be emulated with an extra XOR+constant. Will add to wishlist, we implement them whenever there's a use case. > I have tons of #ifdef there Seems reasonable if you only target v7 and ASIMD; but #ifdef is increasingly infeasible now that SVE and Risc-V V are coming, no? > to support NEON which differs substantially, t
Read the rest
here’s stuff like vrev64q_f32 and vextq_f32 Those can actually be bridged just fine, they correspond to Shuffle2301 and CombineShiftRightLanes. > Even if you expose all the missing horizontal stuff in highway — won’t be much better than intrinsics. Such code ain’t gonna use AVX512 when available. Because of the hardcoded vector size? I agree that's best avoided, in your case perhaps by batching the matrix mul and applying SIMD over that dimension instead? Even if not, I'd rather have type-safety, friendlier function names and gaps in the ISA filled, but tastes differ.
In AVX512/VBMI2: A Programmer’s Perspective
> things like that (highway, OpenMP 4.0+, automatic vectorizers) are only good for vertical operations. I agree autovec and #pragma omp simd struggle with any kind of shuffles, but Highway does not belong in that category - it offers more control, similar to intrinsics. There are about two dozen non-vertical ops (see https://github.com/google/highway/blob/master/g3doc/quick_re... and "blockwise" and "swizzle") and it sounds like you want Set and ConcatUpperLower. In your experience, have you needed any non-vertical ops that are not in that list?
In AVX512/VBMI2: A Programmer’s Perspective
> In my line of work, AVX512 is useless. This won't change until at least 25% market penetration on clients, which may or may not happen. Why not use it where available? github.com/google/highway lets you write code once using 'platform-independent intrinsics', and generate AVX2/AVX-512/NEON/SVE into a single binary; dynamic dispatch runs the best available codepath for the current CPU. Disclosure: I am the main author. Happy to discuss.
In AVX512/VBMI2: A Programmer’s Perspective
Nice writeup with helpful diagrams, thanks for sharing! Readers might also find this short intro [1] helpful, including tips on porting. (Disclosure: author) 1: https://github.com/google/highway/blob/master/g3doc/highway_... > many available instructions are missing from the wrappers Highway can interop with platform-specific intrinsics (on x86/ARM, hwy_vec.raw is the native intrinsic type). > vectorized integer math often treats vectors as having different lanes count on every line of code Fair point, that's a cost of type safety. We usually write `auto` to avoid spelling it out.
In SIMD for C++ Developers [pdf]

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.