GNU bug report logs -
#18607
24.3.93; Warn user if finding fqdn is too slow
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Severity: wishlist
Context :
Sometimes we encounter the known problem "Emacs startup on GNU/Linux
systems [...] is slow." (see e.g. #1492, #9291) and the only visible
effect is that emacs is slow.
The fact that emacs being slow at startup is sometimes considered normal
means that the above problem might be overlooked. (That's exactly what
happened to me the last few weeks, I'm happily generalizing this to
everyone.)
Hence I suggest to warn the user about the situation.
As I know absolutely nothing about C, I googled and came up with the,
possibly horrid, patch below.
diff --git a/src/ChangeLog b/src/ChangeLog
index 00a10f2..20b4e72 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2014-10-02 Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
+
+ * sysdep.c (init_system_name): Warn if the function takes too much
+ time.
+
2014-10-01 Jan Djärv <jan.h.d <at> swipnet.se>
* xfaces.c (Finternal_set_lisp_face_attribute): Don't try to
diff --git a/src/sysdep.c b/src/sysdep.c
index 3870b8d..5495370 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1341,6 +1341,9 @@ extern int h_errno;
void
init_system_name (void)
{
+ time_t start, end;
+ double dif;
+ time (&start);
#ifndef HAVE_GETHOSTNAME
struct utsname uts;
uname (&uts);
@@ -1471,6 +1474,11 @@ init_system_name (void)
if (*p == ' ' || *p == '\t')
*p = '-';
}
+ time (&end);
+ dif = difftime (end, start);
+ if (dif > 4) {
+ fprintf (stderr, "It was very long to init system name. See etc/PROBLEMS via C-h C-p\n");
+ }
}
sigset_t empty_mask;
--
Nicolas Richard
This bug report was last modified 7 years and 38 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.