unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* file-remote-p being called too often?
@ 2024-01-16 21:17 T.V Raman
  2024-01-17 11:54 ` Michael Albinus
  2024-01-17 12:00 ` Eli Zaretskii
  0 siblings, 2 replies; 19+ messages in thread
From: T.V Raman @ 2024-01-16 21:17 UTC (permalink / raw)
  To: emacs-devel

this is with emacs built from Git@HEAD:
Discovered while profiling code in *scratch* via profiler-report:

It looks like file-remote-p gets called from a timer (not started by e)
and that that function shows up as being one of the ones eating cycles.


-- 



^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: file-remote-p being called too often?
@ 2024-01-17 19:57 David Ponce
  2024-01-17 21:01 ` T.V Raman
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: David Ponce @ 2024-01-17 19:57 UTC (permalink / raw)
  To: Emacs Devel; +Cc: raman, Eli Zaretskii

> this is with emacs built from Git@HEAD:
> Discovered while profiling code in *scratch* via profiler-report:
> 
> It looks like file-remote-p gets called from a timer (not started by e)
> and that that function shows up as being one of the ones eating cycles.

I wonder if the problem could be due to recentf if the option
`recentf-auto-cleanup' is enabled to cleanup the recentf list each
time Emacs has been idle during N seconds?

Because in this case, the function `recentf-cleanup' is called every N
seconds, in turn calling `recentf-keep-p' to checks if a file name
should be kept in the recentf list based on the `recentf-keep' option,
whose default value is the predicate `recentf-keep-default-predicate'
that uses `file-remote-p':

(defun recentf-keep-default-predicate (file)
   "Return non-nil if FILE should be kept in the recent list.
It handles the case of remote files as well."
   (cond
    ((file-remote-p file nil t) (recentf-access-file file))
    ((file-remote-p file))
    ((file-readable-p file))))

Regards



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-01-18 16:28 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-16 21:17 file-remote-p being called too often? T.V Raman
2024-01-17 11:54 ` Michael Albinus
2024-01-17 14:55   ` T.V Raman
2024-01-17 15:28     ` Michael Albinus
2024-01-17 18:15       ` T.V Raman
2024-01-17 12:00 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2024-01-17 19:57 David Ponce
2024-01-17 21:01 ` T.V Raman
2024-01-17 21:04 ` T.V Raman
2024-01-17 21:18 ` T.V Raman
2024-01-18  5:41   ` Eli Zaretskii
2024-01-18 14:43     ` T.V Raman
2024-01-17 21:56 ` T.V Raman
2024-01-18  5:56   ` Eli Zaretskii
2024-01-18  7:30     ` Michael Albinus
2024-01-18 14:44       ` T.V Raman
2024-01-18 15:07         ` Eli Zaretskii
2024-01-18 15:57           ` T.V Raman
2024-01-18 16:28             ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).