diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,3 +1,9 @@
+3.12.5 [2026.01.10]
+-------------------
+* Use a more efficient implementation for `zipWithKey` in the `ZipWithKey`
+  instance for `HashMap`.
+* Remove unused `semigroups` and `transformers-compat` dependencies.
+
 3.12.4 [2024.12.06]
 -------------------
 * Require building with GHC 8.0 or later.
diff --git a/keys.cabal b/keys.cabal
--- a/keys.cabal
+++ b/keys.cabal
@@ -1,6 +1,6 @@
 name:          keys
 category:      Data Structures, Containers
-version:       3.12.4
+version:       3.12.5
 license:       BSD3
 cabal-version: >= 1.10
 license-file:  LICENSE
@@ -20,10 +20,11 @@
 
 build-type:    Simple
 extra-source-files: CHANGELOG.markdown README.markdown cabal.project
-tested-with:   GHC == 9.12.1
-             , GHC == 9.10.1
+tested-with:   GHC == 9.14.1
+             , GHC == 9.12.2
+             , GHC == 9.10.3
              , GHC == 9.8.4
-             , GHC == 9.6.6
+             , GHC == 9.6.7
              , GHC == 9.4.8
              , GHC == 9.2.8
              , GHC == 9.0.2
@@ -36,7 +37,7 @@
 
 source-repository head
   type: git
-  location: git://github.com/ekmett/keys.git
+  location: https://github.com/ekmett/keys.git
 
 library
   default-language: Haskell2010
@@ -46,15 +47,13 @@
     array                >= 0.3.0.2 && < 0.6,
     base                 >= 4.9     && < 5,
     comonad              >= 4       && < 6,
-    containers           >= 0.3     && < 0.8,
+    containers           >= 0.3     && < 0.9,
     free                 >= 4       && < 6,
     hashable             >= 1.1.2.3 && < 1.6,
     semigroupoids        >= 5.2     && < 7,
-    semigroups           >= 0.8.3.1 && < 1,
     tagged               >= 0.7.3   && < 1,
-    transformers         >= 0.2     && < 0.7,
-    transformers-compat  >= 0.3     && < 1,
-    unordered-containers >= 0.2.4   && < 0.3
+    transformers         >= 0.5     && < 0.7,
+    unordered-containers >= 0.2.6   && < 0.3
 
   exposed-modules:
     Data.Key
diff --git a/src/Data/Key.hs b/src/Data/Key.hs
--- a/src/Data/Key.hs
+++ b/src/Data/Key.hs
@@ -1349,11 +1349,7 @@
   zipWith = HashMap.intersectionWith
 
 instance (Eq k, Hashable k) => ZipWithKey (HashMap k) where
-  zipWithKey f a b = HashMap.foldlWithKey' go HashMap.empty a
-    where
-      go m k v = case lookup k b of
-                   Just w -> HashMap.insert k (f k v w) m
-                   _      -> m
+  zipWithKey = HashMap.intersectionWithKey
 
 instance FoldableWithKey (HashMap k) where
   foldrWithKey = HashMap.foldrWithKey
