[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: Use a bigger start size for the hash table
From: |
Christopher Baines |
Subject: |
03/03: Use a bigger start size for the hash table |
Date: |
Sun, 3 Oct 2021 10:29:15 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository data-service.
commit ba9bcbf7356c0ae703bd583fea4f3f37104da10c
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sun Oct 3 15:28:40 2021 +0100
Use a bigger start size for the hash table
This might help when there's lots of derivations to insert.
---
guix-data-service/model/derivation.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/guix-data-service/model/derivation.scm
b/guix-data-service/model/derivation.scm
index b258803..208bee6 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -1786,7 +1786,10 @@ INNER JOIN derivation_source_files
(if (null? derivation-file-names)
'()
(let* ((derivations-count (length derivation-file-names))
- (derivation-ids-hash-table (make-hash-table derivations-count)))
+ (derivation-ids-hash-table (make-hash-table
+ ;; Account for more derivations in
+ ;; the graph
+ (* 2 derivations-count))))
(simple-format
#t "debug: derivation-file-names->derivation-ids: processing ~A
derivations\n"
derivations-count)