Skip to content

Commit 76066e1

Browse files
committed
LMDB Disk Cache: use batch remove when removing multiple keys
1 parent 9a60c49 commit 76066e1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib/disk_cache/lmdb/disk_cache.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ module Make (Data : Binable.S) = struct
7272

7373
Error_checking_mutex.critical_section queue_guard ~f:(fun () ->
7474
if Queue.length reusable_keys >= reuse_size_limit then (
75-
Queue.iter reusable_keys ~f:(fun to_remove ->
76-
Rw.remove ~env db to_remove ) ;
75+
Rw.batch_remove ~env db reusable_keys ;
7776
Queue.clear reusable_keys ) ) ;
7877
Rw.set ~env db idx x ;
7978
res

0 commit comments

Comments
 (0)