Ron <rjpeace@xxxxxxxxxxxxx> writes: > For an even more extreme speedup, don't most modern CPUs have an asm > instruction that counts the bits (un)set (AKA "population counting") > in various size entities (4b, 8b, 16b, 32b, 64b, and 128b for 64b > CPUs with SWAR instructions)? Yeah, but fetching from a small constant table is pretty quick too; I doubt it's worth getting involved in machine-specific assembly code for this. I'm much more interested in the idea of improving the furthest-distance algorithm in gtsvector_picksplit --- if we can do that, it'll probably drop the distance calculation down to the point where it's not really worth the trouble to assembly-code it. regards, tom lane