eulerto / pg_similarity

set of functions and operators for executing similarity queries
BSD 3-Clause "New" or "Revised" License
363 stars 39 forks source link

Implement hamming distance between int32 #13

Closed JVillella closed 5 years ago

JVillella commented 7 years ago

This PR adds native support for hamming distance between two integers. As ints we can use __builtin_popcount which gives considerable performance improvements. @eulerto this is something I needed, posting it in case you think it's generally useful and would like to include.

JVillella commented 5 years ago

Gotten stale, and looks like the change isn't being considered. I also haven't used this library in years, so won't be able to incorporate any suggestions.

eulerto commented 5 years ago

@JVillella I don't remember why I don't consider it at that time. However, checking this PR, I saw that it uses a gcc-ism (that was available in clang too) but __builtin_popcount is not available in MSVC AFAIR. It also does not provide sufficient documentation. If you provide fixes, I'm glad to review and incorporate them.