From: Maxime Devos <maximedevos@telenet.be>
To: Andrew Tropin <andrew@trop.in>, 54762@debbugs.gnu.org
Subject: [bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file-exists?.
Date: Thu, 07 Apr 2022 20:21:35 +0200 [thread overview]
Message-ID: <be6efed627587bf2a962db2f76615b8de538c2ba.camel@telenet.be> (raw)
In-Reply-To: <87bkxc6d5t.fsf@trop.in>
[-- Attachment #1: Type: text/plain, Size: 839 bytes --]
Andrew Tropin schreef op do 07-04-2022 om 20:01 [+0300]:
> Idk how file-exists? works internally, but still expect it to be more
> efficient than lstat. That's why I decided to use lstat only as a
> "fallback" option in `or` statement.
Here's the definition, from module/ice-9/boot-9.scm (Guile source
code):
;; For reference, Emacs file-exists-p uses stat in this same way.
(define file-exists?
(if (provided? 'posix)
(lambda (str)
(->bool (stat str #f)))
[non-POSIX code that's not relevant to Guix]))
'file-exists?' just calls 'stat', a variant of 'lstat', so I don't
think there are performance gains to be had here. Well, the
(stat ... #f) might not need to install an exception handler since it
is written in C, but that seems at most a micro-optimisation to me.
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
next prev parent reply other threads:[~2022-04-07 18:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 8:22 [bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file-exists? Andrew Tropin
2022-04-07 12:28 ` Maxime Devos
2022-04-07 17:01 ` Andrew Tropin
2022-04-07 18:17 ` Maxime Devos
2022-04-07 18:21 ` Maxime Devos [this message]
2022-04-08 4:23 ` Andrew Tropin
2022-04-09 21:57 ` bug#54762: " Ludovic Courtès
2022-04-11 5:26 ` [bug#54762] " Andrew Tropin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=be6efed627587bf2a962db2f76615b8de538c2ba.camel@telenet.be \
--to=maximedevos@telenet.be \
--cc=54762@debbugs.gnu.org \
--cc=andrew@trop.in \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).