Top all-time · #1256
Wojciech Muła
Personal blog · 0x80.pl · on HN as wmuprogrammingsystems
Wojciech Muła's personal blog at 0x80.pl covers programming and systems. Since 2011, 55 different Hacker News readers have linked it 101 times, most often “SIMD-friendly algorithms for substring searching”. It is still writing: the last post was on 2026-01-08, and you can follow it by feed.
Sometimes recommended · 12 of 40 sampled comments recommend it?
Why HN links it
HN readers link Wojciech Muła's 0x80.pl for articles on SIMD and SWAR techniques, such as popcount, substring search and byte lookup, and often recommend them as reference reading on low-level optimisation.
- Recommended for · 12 comments
- Called an excellent implementation and well worth exploring; a favourite algorithm; small and quite understandable code; explained well; a good discussion with
Summarised by Claude from a sample of 40 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- SIMD-friendly algorithms for substring searching9 people · 9 mentions · first linked 2016-11-28
- AVX2 faster than native popcnt instruction on Haswell/Skylake7 people · 8 mentions · first linked 2016-03-13
- Parsing Series of Integers with SIMD (2018)5 people · 5 mentions · first linked 2018-04-19
- RISC-V Vector Extension overview4 people · 4 mentions · first linked 2024-11-09
- SIMD-friendly algorithms for substring searching (2016)3 people · 6 mentions · first linked 2025-04-18
- SIMDized check which bytes are in a set3 people · 4 mentions · first linked 2018-10-19
- SIMDized check which bytes are in a set3 people · 3 mentions · first linked 2024-12-22
- Perfect Hashing for Strings with PEXT3 people · 3 mentions · first linked 2023-04-30
- Rust Is Perfectly Imperfect3 people · 3 mentions · first linked 2026-01-08
- /articles/simd-strfind.html2 people · 3 mentions · first linked 2020-10-08
What Hacker News says?
The latter is generally not faster on most modern chips. Results in similar microcode to non vectoring assembly, but you need to put data in the SSE registers which is not free. A smart compiler would not use the new SSE version. (perhaps you didn't set the flags right?) This is why: http://0x80.pl/articles/sse-popcount.html
Comment linking /articles/sse-popcount.html
on “GodBolt: Enter C, get Assembly”Submitted SIMD-friendly algorithms for substring searching (2016) as a story · 223 points
HN discussionDepends on your goals? If you'd like to contribute code under Apache2, I'd be happy to collaborate. Feel free to reach out to the email in the Highway README. Some of the things on my short to medium-term todo list include: - CompressStore for 8-bit lanes (before Icelake, that will likely require splitting up into runs of 8 bytes with one PSHUFB + store each) - also ExpandLoad (analogous to CompressStore) and Leadin…
Comment linking /notesen/2021-01-18-autovectorization-gcc-clang.html
on “Vectorized and performance-portable Quicksort”Submitted Is sorted using SIMD instructions as a story · 177 points
HN discussionRegarding the C++ version: instead of copying data to a vector and then sorting the vector, it might be more profitable to use std::multimap<size_t, string>. This is a sorted container (likely rb-tree based) that handles duplicated keys. Also, as somebody else mentioned, iostreams are slow. Even simple reading of file can be several times slower than plain C ( http://0x80.pl/notesen/2019-01-07-cpp-read-file.html ).
Comment linking /notesen/2019-01-07-cpp-read-file.html
on “Performance comparison: counting words in Python, Go, C++, C, Awk, Forth, Rust”Submitted Dividing unsigned 8-bit numbers as a story · 162 points
HN discussionThere is more! You can be _faster_ than __builtin_popcount()! Wojciech Muła did an excellent SSSE3 implementation: http://0x80.pl/articles/sse-popcount.html My understanding is that the set-up time is slower than the POPCNT cpu instruction, but throughput is higher. Useful if you need to count bits not on a register, but on a whole array.
Comment linking /articles/sse-popcount.html
on “Popcount CPU instruction”Submitted AVX512 VBMI – remove spaces from text as a story · 152 points
HN discussionWojciech Muła really groks SIMD. It's well worth exploring his other work in that area: http://0x80.pl/articles/index.html
Comment linking /articles/index.html
on “Base64 encoding and decoding at almost the speed of a memory copy”Submitted AVX2 faster than native popcnt instruction on Haswell/Skylake as a story · 147 points
HN discussionThey were sufficient for me to implement most of `string.h` and get speedups between 4 and 16x vs “portable musl C code,” including sophisticated algorithms such as this one: http://0x80.pl/notesen/2016-11-28-simd-strfind.html I posted about my efforts here: https://news.ycombinator.com/item?id=43935284 Or, if you wanna jump to the code: https://github.com/ncruces/go-sqlite3/blob/main/sqlite3/libc...
Comment linking /notesen/2016-11-28-simd-strfind.html
on “WASM 2.0”Submitted Parsing Series of Integers with SIMD (2018) as a story · 67 points
HN discussionEven assuming just a-z, that array will be mostly empty at lower levels, and most nodes are at lower levels. That’s not good for avoiding cache misses. There are tricks to counteract that (you don’t store pointers to lower levels, for example, but offsets, because at typical sizes of a trie you can store them in way fewer bits), and I haven’t timed any implementation for decades, but it would surprise me if such an…
Comment linking /articles/simd-strfind.html
on “Use perfect hashing, instead of binary search, for keyword lookup”Submitted Parsing series of integers with SIMD (2018) as a story · 64 points
HN discussionWhen you add prefetching (that is, compare against the middle element and fetch both the middle of the left half and the middle of the right half ahead of time) you are essentially doing radix-4 search, just with fewer actual comparisons. (You can prefetch k layers ahead for radix-2^k search, but searching in small arrays will become more expensive this way.) I didn't benchmark it, but I guess on mid-to-large arrays…
Comment linking /articles/simd-search.html
on “Algorithms for Modern Hardware”Submitted SIMD Binary Heap Operations as a story · 60 points
HN discussion> - Parsing an integer in JSON requires multiplication by 10 and addition / subtraction for each digit. Meanwhile, in protobuf, fixed64 and related types are either in host order or are just a ntohl away; int64 and other varint types only require bit twiddling (masks, shifts, etc). Do you think it's easier to parse "4294967296" from a string, or 5 bytes along the lines of {0x88, 0x80, 0x80, 0x80, 0x00}? For this one…
Comment linking /articles/simd-parsing-int-sequences.html
on “Scan HTML faster with SIMD instructions – Chrome edition”Submitted Base64 decoding with SIMD instructions as a story · 53 points
HN discussionI don't really know how this algorithm works because it doesn't seem to consume the input at all, but some techniques are here: http://0x80.pl/articles/simd-byte-lookup.html
Comment linking /articles/simd-byte-lookup.html
on “Scan HTML faster with SIMD instructions – Chrome edition”Submitted LoongArch64 Subjective Higlights as a story · 49 points
HN discussionSpeaking of modern computers, have you compared it to these SIMD string find algorithms by Wojciech Muła? They're a bit more recent: http://0x80.pl/articles/simd-strfind.html
Comment linking /articles/simd-strfind.html
on “The Boyer-Moore Fast String Searching Algorithm”Submitted Bit Test and Reset vs. Compilers as a story · 36 points
HN discussionIt does actually! But only in some cases. See https://github.com/BurntSushi/ripgrep/issues/617#issuecommen... and https://github.com/rust-lang/regex/issues/408 and https://github.com/rust-lang/regex/pull/419 Note though that it is going away soon. It's going to be replaced with a combination of Two-Way, Rabin-Karp and a fast vectorized prefilter based on this: http://0x80.pl/articles/simd-strfind.html#algorithm-1-ge…
Comment linking /articles/simd-strfind.html
on “The Boyer-Moore Fast String Searching Algorithm”Submitted How to check if any word is zero (2021) as a story · 27 points
HN discussionThe SIMD string matching optimization unfortunately missed a trick -- it's more selective to match the first and last characters of a pattern than the first two, and it's the same cost. Credit to Muła for this one: http://0x80.pl/notesen/2016-11-28-simd-strfind.html#generic-... .
Comment linking /notesen/2016-11-28-simd-strfind.html
on “Optimizing ClickHouse for Intel's ultra-high core count processors”Submitted Parsing series of integers with SIMD as a story · 27 points
HN discussionUse inline assembly or intrinsics. Read the code of stuff that does these things. Resources sufficient for implementing simdjson or similar vectorized parsers: https://www.intel.com/content/www/us/en/docs/intrinsics-guid... https://lemire.me/blog/ http://0x80.pl/articles/
Comment linking /articles/
on “Do low-level optimizations matter? Faster quicksort with cmov (2020)”Submitted Use AVX512 Galois field affine transformation for bit shuffling as a story · 14 points
HN discussionYou can test whether a register full of bytes belong to a class of bytes with the high bit unset and distinct lower nibbles in 2 instructions (each with 1 cycle latency). For example the characters that commonly occur in text and must be escaped in json are "\"\\\r\n\t" (5 different bytes). Their lower nibbles are: \": 0010 \t: 1001 \n: 1010 \\: 1100 \r: 1101 Since there are no duplicate lower nibbles, we can test f…
Comment linking /notesen/2018-10-18-simd-byte-lookup.html
on “Dividing unsigned 8-bit numbers”Submitted RISC-V Vector Extension overview as a story · 10 points
HN discussion