pgvector.git / summary / log / commit / refs
commit 421a35fcdcb2581685dd3942d4b9036bfecb72b9
Author: Andrew Kane <andrew@ankane.org>
Date: Thu Jun 11 02:55:21 2026 +0000
Fixed performance regression with Hamming distance and Jaccard distance with Postgres 18 - fixes #985
CHANGELOG.md | 4 ++++
src/bitutils.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e7f6ec74..fa998baa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.8.3 (unreleased)
+
+- Fixed performance regression with Hamming distance and Jaccard distance with Postgres 18
+
## 0.8.2 (2026-02-25)
- Fixed buffer overflow with parallel HNSW index build - [more info](https://github.com/pgvector/pgvector/issues/959)
diff --git a/src/bitutils.c b/src/bitutils.c
index 366e670d..8e24c993 100644
--- a/src/bitutils.c
+++ b/src/bitutils.c
@@ -32,9 +32,9 @@
#endif
/* Use built-ins when possible for inlining */
-#if defined(HAVE__BUILTIN_POPCOUNT) && defined(HAVE_LONG_INT_64)
+#if defined(HAVE__BUILTIN_POPCOUNT) && (defined(HAVE_LONG_INT_64) || SIZEOF_LONG == 8)
#define popcount64(x) __builtin_popcountl(x)
-#elif defined(HAVE__BUILTIN_POPCOUNT) && defined(HAVE_LONG_LONG_INT_64)
+#elif defined(HAVE__BUILTIN_POPCOUNT) && (defined(HAVE_LONG_LONG_INT_64) || SIZEOF_LONG_LONG == 8)
#define popcount64(x) __builtin_popcountll(x)
#elif !defined(_MSC_VER)
/* Fails to resolve with MSVC */
[parent: 12368bd79c46]