logoalt Hacker News

camel-cdrtoday at 5:35 AM1 replyview on HN

I don't quite get how something like highway doesn't cover this, while intrinsics do.

Can you explain the usecase more concretely?


Replies

jandrewrogerstoday at 6:33 AM

Almost literally what I stated. Consider a row in Postgres table or similar. Convert the entire WHERE clause across all columns in that table into a very short sequence of SIMD instructions against the same memory. All of the columns, regardless of type, are evaluated simultaneously using SIMD. For many complex constraints you can match rows in single digit clock cycles even across many unrelated types. This is much faster than using secondary indexes in many cases.

It isn’t hypothetical, I’ve shipped systems that worked this way. You can match search patterns across a random dozen columns across a schema of hundreds of columns at essentially full memory bandwidth.

show 1 reply