[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/07: publish: Avoid 'valid-path?' RPC for non-existent items.
From: |
Ludovic Courtès |
Subject: |
06/07: publish: Avoid 'valid-path?' RPC for non-existent items. |
Date: |
Fri, 21 Jul 2017 11:04:13 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit deac674ab4015e52fb6fb883f578e5c5891291a4
Author: Ludovic Courtès <address@hidden>
Date: Fri Jul 21 14:52:08 2017 +0200
publish: Avoid 'valid-path?' RPC for non-existent items.
* guix/scripts/publish.scm (render-narinfo/cached): Call 'file-exists?'
before calling 'valid-path?'. This makes the 404 path slightly faster.
---
guix/scripts/publish.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index cb1abc3..cd57b13 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -417,7 +417,8 @@ requested using POOL."
(display (call-with-input-file cached
read-string)
port))))
- ((valid-path? store item)
+ ((and (file-exists? item) ;cheaper than the 'valid-path?' RPC
+ (valid-path? store item))
;; Nothing in cache: bake the narinfo and nar in the background and
;; return 404.
(eventually pool
- branch master updated (0cf9f9b -> c95644f), Ludovic Courtès, 2017/07/21
- 03/07: base32: Export the base32 charsets., Ludovic Courtès, 2017/07/21
- 04/07: publish: Remove 'regexp-exec' call from the hot path., Ludovic Courtès, 2017/07/21
- 05/07: store: Rewrite 'store-path-hash-part' to not use regexps., Ludovic Courtès, 2017/07/21
- 06/07: publish: Avoid 'valid-path?' RPC for non-existent items.,
Ludovic Courtès <=
- 07/07: publish: Make the cache eviction policy less aggressive., Ludovic Courtès, 2017/07/21
- 01/07: substitute: Optimize hash-part-to-path conversion on non-200 responses., Ludovic Courtès, 2017/07/21
- 02/07: substitute: Avoid repeated calls to 'length'., Ludovic Courtès, 2017/07/21