emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Agenda is slow because of vc-mode
@ 2010-06-07 12:25 Daniel Clemente
  2010-06-18 16:19 ` David Maus
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Clemente @ 2010-06-07 12:25 UTC (permalink / raw)
  To: Org-mode Org-Mode

Hi.

  I have a shell script which exports my agenda to a file. It's pretty
slow: about 90 seconds. There are many files (200 .org files, 76k
lines, 3'6 Mb, 1600 open tasks) but the performance should be better.
  I found a way to bring it down to 11 seconds: temporarily disable
the version control tools I'm using (bazaar, git). To test, just
change their names so that Emacs can't run them.

  Since this slowness is caused by vc-mode, I wonder if it's possible
for Org to open the agenda files without enabling vc-mode, for vc-mode
is not necessary for org-mode.
  I fear not, because org-agenda-get-day-entries uses
org-get-agenda-file-buffer to open a buffer normally, and this buffer
should be fully functional for later usage.

  As a hack, I used (defun vc-find-file-hook () nil) in my script;
this does the trick.

  Greetings,

Daniel

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

* Re: Agenda is slow because of vc-mode
  2010-06-07 12:25 Agenda is slow because of vc-mode Daniel Clemente
@ 2010-06-18 16:19 ` David Maus
  2010-06-18 19:16   ` Greg Troxel
  0 siblings, 1 reply; 3+ messages in thread
From: David Maus @ 2010-06-18 16:19 UTC (permalink / raw)
  To: Daniel Clemente; +Cc: Org-mode Org-Mode


[-- Attachment #1.1: Type: text/plain, Size: 1590 bytes --]

Daniel Clemente wrote:
>Hi.

>  I have a shell script which exports my agenda to a file. It's pretty
>slow: about 90 seconds. There are many files (200 .org files, 76k
>lines, 3'6 Mb, 1600 open tasks) but the performance should be better.
>  I found a way to bring it down to 11 seconds: temporarily disable
>the version control tools I'm using (bazaar, git). To test, just
>change their names so that Emacs can't run them.

>  Since this slowness is caused by vc-mode, I wonder if it's possible
>for Org to open the agenda files without enabling vc-mode, for vc-mode
>is not necessary for org-mode.
>  I fear not, because org-agenda-get-day-entries uses
>org-get-agenda-file-buffer to open a buffer normally, and this buffer
>should be fully functional for later usage.

That's indeed the problem: Its hard to figure a default options for
such functionality.

>  As a hack, I used (defun vc-find-file-hook () nil) in my script;
>this does the trick.

Instead of overloading `vc-find-file-hook' you could use something
like this:

(defun dmj/disable-vc-for-agenda-files-hook ()
  "Disable vc-mode for Org agenda files."
  (if (and (fboundp 'org-agenda-file-p)
	   (org-agenda-file-p (buffer-file-name)))
      (remove-hook 'find-file-hook 'vc-find-file-hook)
    (add-hook 'find-file-hook 'vc-find-file-hook)))

(add-hook 'find-file-hook 'dmj/disable-vc-for-agenda-files-hook)

It removes vc-find-file-hook from the list of find-file-hooks when the
file is question is an agenda file.

HTH
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Agenda is slow because of vc-mode
  2010-06-18 16:19 ` David Maus
@ 2010-06-18 19:16   ` Greg Troxel
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Troxel @ 2010-06-18 19:16 UTC (permalink / raw)
  To: David Maus; +Cc: Org-mode Org-Mode


[-- Attachment #1.1: Type: text/plain, Size: 445 bytes --]


  >  Since this slowness is caused by vc-mode, I wonder if it's possible
  >for Org to open the agenda files without enabling vc-mode, for vc-mode
  >is not necessary for org-mode.

I suspect part of the problem is that vc-mode is slower than it should
be.  Probably almost all of this time is 'git status foo.org' to find
out if the buffer gets a * or not.  Perhaps a variable to vc-mode to
omit that part would help, but I don't really know.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2010-06-18 19:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-07 12:25 Agenda is slow because of vc-mode Daniel Clemente
2010-06-18 16:19 ` David Maus
2010-06-18 19:16   ` Greg Troxel

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

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