Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 281009 - app-editors/emacs startup is slow in git trees
Summary: app-editors/emacs startup is slow in git trees
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Emacs project
URL: http://thread.gmane.org/gmane.emacs.d...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-10 15:41 UTC by Joakim Tjernlund
Modified: 2009-08-24 18:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
.emacs file (.emacs,1.88 KB, text/plain)
2009-08-10 21:09 UTC, Joakim Tjernlund
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Tjernlund 2009-08-10 15:41:36 UTC
Whenever I open a dev-util/git controlled file I see this msg in emacs:
 loading git-vcs...done
It can take many seconds until this message goes away and the file
just loaded becomes visible. I have tried to turn it off but
not succeded.
Is there a cure so emacs loads git-vcs in the background so
I can get to the file right away?

Reproducible: Always
Comment 1 James Earl Spahlinger 2009-08-10 20:47:32 UTC
Please paste the output of 'emerge --info' into a bugzilla comment to assist the maintainers in resolving this issue

Also attach your ~/.emacs as well although I'm not too sure how much the gentoo maintainers are going to be able to assist you as this does not read like a gentoo specific bug.
Comment 2 Joakim Tjernlund 2009-08-10 21:09:00 UTC
Created attachment 200868 [details]
.emacs file
Comment 3 Joakim Tjernlund 2009-08-10 21:10:20 UTC
Here is emereg --info

Would be good to know if I am the only one notecing this.

emerge --info
Portage 2.1.6.13 (default/linux/x86/2008.0/desktop, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.30-gentoo-r1 i686)
=================================================================
System uname: Linux-2.6.30-gentoo-r1-i686-Intel-R-_Core-TM-2_Duo_CPU_E8500_@_3.16GHz-with-glibc2.0
Timestamp of tree: Sun, 09 Aug 2009 19:00:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.5.4-r3
dev-util/cmake:      2.6.4
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/X11/gdm/Xsession /etc/X11/gdm/locale.alias /etc/ca-certificates.conf /etc/conf.d/hald /etc/conf.d/splash /etc/conf.d/svnserve /etc/dbus-1 /etc/env.d /etc/env.d/java/ /etc/fonts /etc/fonts/fonts.conf /etc/gconf /etc/init.d /etc/pam.d/gdm /etc/pam.d/gdm-autologin /etc/pam.d/gdmsetup /etc/revdep-rebuild /etc/sandbox.d /etc/sound/events /etc/splash /etc/terminfo /etc/udev/rules.d /etc/xdg"
CXXFLAGS="-O2 -march=i686"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en sv"
MAKEOPTS="-j3 -s"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/transmode"
SYNC="rsync://devsrv.transmode.se/latest-portage"
USE="X a52 aac accessibility acl acpi ads alsa bash-completion berkdb bluetooth branding bzip2 cairo cdr cli cracklib crypt cups dbus dri dvd dvdr eds emacs emboss encode esd evo fam firefox flac fortran gdbm gif gnome gpm gstreamer gtk hal iconv ipv6 isdnlog jpeg kerberos kvm ldap libnotify mad mikmod mp3 mp4 mpeg mudflap ncurses nis nls nptl nptlonly ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3support quicktime readline reflection samba sdl session spell spl sqlite ssl startup-notification subversion svg sysfs tcpd tiff truetype unicode usb vorbis win32codecs x264 x86 xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en sv" USERLAND="GNU" VIDEO_CARDS="vesa intel"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 James Earl Spahlinger 2009-08-10 21:16:25 UTC
You might also want to drop a note by the gentoo forums to see if others have your issue.
Comment 5 Mike Auty (RETIRED) gentoo-dev 2009-08-15 15:31:19 UTC
You should be able to disable this functionality by adding the following line to /etc/portage/package.use:

dev-util/git -emacs

and then re-emerge git.  This will disable the emacs USE flag for git, and ensure that the git-emacs additions are not installed.  Please try this, and report back whether that's solved your problem.  
Comment 6 Ulrich Müller gentoo-dev 2009-08-15 18:48:46 UTC
(In reply to comment #5)
> You should be able to disable this functionality by adding the following line
> to /etc/portage/package.use:
> 
> dev-util/git -emacs
> 
> and then re-emerge git.

I'm not sure that this would help, as dev-util/git doesn't install any git-vcs.el. In fact, I wonder where this file belongs to.

Could you please post the output of "qfile git-vcs.el" so that find out what package installs the file? (You need to emerge portage-utils for qfile.)
Comment 7 Joakim Tjernlund 2009-08-16 07:36:27 UTC
There is only a vc-git.el:
 qfile vc-git.el
app-editors/emacs (/usr/share/emacs/22.3/lisp/vc-git.el)

I guess I misspellt it the first time, sorry.
Comment 8 Ulrich Müller gentoo-dev 2009-08-17 07:11:49 UTC
With the given information, I cannot reproduce the problem. Is your git tree publicly available?

Things you could try:
  1. Does the problem still occur if you start Emacs with "emacs -Q"?
  2. Does it still occur with Emacs 23.1?
Comment 9 Joakim Tjernlund 2009-08-17 07:30:07 UTC
emacs -Q <file> didn't help.

This happens with any git tree. It would have to somewhat big to see the
effects. The normal linux kernel git repo will do.

Do you see the "Loading vc-git...done" at all?
Once the git tree is in the VFS cache it is fast, I
always see "Loading vc-git...done" though.

emacs 23.1 is a bit away for me ATM, but I will try it later.
Comment 10 Ulrich Müller gentoo-dev 2009-08-17 15:18:58 UTC
> This happens with any git tree. It would have to somewhat big to see the
> effects. The normal linux kernel git repo will do.

I've tested with various files within the kernel tree, but there is no noticeable delay for me.

> Do you see the "Loading vc-git...done" at all?

Yes, but only for the first file that I open in Emacs. For subsequent files the message doesn't appear.
Comment 11 Joakim Tjernlund 2009-08-17 15:53:41 UTC
(In reply to comment #10)
> > This happens with any git tree. It would have to somewhat big to see the
> > effects. The normal linux kernel git repo will do.
> 
> I've tested with various files within the kernel tree, but there is no
> noticeable delay for me.

Right, but you have do it with a cold VFS cache. Once VFS has read
the git tree, it will be very fast so you don notice any delay
try "echo 3 > /proc/sys/vm/drop_caches" as root, then open
a fresh "emacs Makefile" inside your kernel tree.

> 
> > Do you see the "Loading vc-git...done" at all?
> 
> Yes, but only for the first file that I open in Emacs. For subsequent files the
> message doesn't appear.
> 

Comment 12 Christian Faulhammer (RETIRED) gentoo-dev 2009-08-17 16:52:07 UTC
I can reproduce it here with Emacs 23.1 and dropped caches.  This does not happen with Bazaar repositories.
Comment 13 Ulrich Müller gentoo-dev 2009-08-17 17:13:45 UTC
(In reply to comment #12)
> I can reproduce it here with Emacs 23.1 and dropped caches.

Yep. It spends its time in "/usr/bin/git diff-index -z HEAD -- Makefile" which is executed from function vc-git-state.

Looks like an upstream issue to me.
Comment 14 Joakim Tjernlund 2009-08-17 18:05:01 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > I can reproduce it here with Emacs 23.1 and dropped caches.
> 
> Yep. It spends its time in "/usr/bin/git diff-index -z HEAD -- Makefile" which
> is executed from function vc-git-state.

Good, you found the cause :)

> 
> Looks like an upstream issue to me.

Yes, I don't know what the right fix is though
Comment 15 Christian Faulhammer (RETIRED) gentoo-dev 2009-08-18 19:47:58 UTC
(In reply to comment #14)
> > Looks like an upstream issue to me.
> 
> Yes, I don't know what the right fix is though

 You should contact upstream on emacs-devel@gnu.org.  If you don't want to do that I can take that task over.  Please put emacs@gentoo.org in CC, so we know about it (we watch the mailing list but may miss it).

Comment 16 Joakim Tjernlund 2009-08-19 06:39:32 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > > Looks like an upstream issue to me.
> > 
> > Yes, I don't know what the right fix is though
> 
>  You should contact upstream on emacs-devel@gnu.org.  If you don't want to do
> that I can take that task over.  Please put emacs@gentoo.org in CC, so we know
> about it (we watch the mailing list but may miss it).
> 

Please do, I think that will be the quickest way to resolve this.
Comment 17 Christian Faulhammer (RETIRED) gentoo-dev 2009-08-24 16:55:53 UTC
Thank you for your report nonetheless, but from upstream's reactions you read that there is more than we can quickly fix.  Keep bugging us though.
Comment 18 Joakim Tjernlund 2009-08-24 18:37:05 UTC
(In reply to comment #17)
> Thank you for your report nonetheless, but from upstream's reactions you read
> that there is more than we can quickly fix.  Keep bugging us though.
> 

NP, I got a way to disable git in my ~/.emacs so I am reasoanbly happy,
the long delay is gone and I don't use the emacs git mode much anyway
so I will get by.
upstream is aware, maybe there will be some effort as time go by.