all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#18607: 24.3.93; Warn user if finding fqdn is too slow
@ 2014-10-02 13:08 Nicolas Richard
  2018-06-07  0:06 ` Noam Postavsky
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Richard @ 2014-10-02 13:08 UTC (permalink / raw)
  To: 18607

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@yahoo.fr>
+
+	* sysdep.c (init_system_name): Warn if the function takes too much
+	time.
+
 2014-10-01  Jan Djärv  <jan.h.d@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");
+  }
 }
 \f
 sigset_t empty_mask;

-- 
Nicolas Richard





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

* bug#18607: 24.3.93; Warn user if finding fqdn is too slow
  2014-10-02 13:08 bug#18607: 24.3.93; Warn user if finding fqdn is too slow Nicolas Richard
@ 2018-06-07  0:06 ` Noam Postavsky
  0 siblings, 0 replies; 2+ messages in thread
From: Noam Postavsky @ 2018-06-07  0:06 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 18607

forcemerge 18607 18142
close 18607
quit

Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:

> 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.)

Since Emacs no longer performs DNS on startup to find fqdn, I think this
is no longer needed.





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

end of thread, other threads:[~2018-06-07  0:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-02 13:08 bug#18607: 24.3.93; Warn user if finding fqdn is too slow Nicolas Richard
2018-06-07  0:06 ` Noam Postavsky

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.