all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: 18607@debbugs.gnu.org
Subject: bug#18607: 24.3.93; Warn user if finding fqdn is too slow
Date: Thu, 02 Oct 2014 15:08:28 +0200	[thread overview]
Message-ID: <87tx3mippv.fsf@geodiff-mac3.ulb.ac.be> (raw)

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





             reply	other threads:[~2014-10-02 13:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02 13:08 Nicolas Richard [this message]
2018-06-07  0:06 ` bug#18607: 24.3.93; Warn user if finding fqdn is too slow Noam Postavsky

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tx3mippv.fsf@geodiff-mac3.ulb.ac.be \
    --to=theonewiththeevillook@yahoo.fr \
    --cc=18607@debbugs.gnu.org \
    /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 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.