emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Logbook drawer entries make editing very slow
@ 2013-02-20  8:03 Marcel van der Boom
  2013-04-18 10:56 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Marcel van der Boom @ 2013-02-20  8:03 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I'm using habit-style items a lot in my 'org' routine. A typical entry
would look like this:

#+BEGIN_SRC org
*** TODO Do something daily                                                     
SCHEDULED: <2013-02-20 wo .+1d>
:LOGBOOK:
- State "DONE"       from "TODO"       [2013-02-19 di 14:01]
- State "DONE"       from "TODO"       [2013-02-17 zo 12:39]
...
[lots of entries here]
...
- State "DONE"       from "TODO"       [2010-02-25 Thu 13:51]
- State "DONE"       from "TODO"       [2010-02-10 Wed 15:19]
:END:
:PROPERTIES:
:STYLE: habit
:LAST_REPEAT: [2013-02-19 di 14:01]
:CREATED: <2011-03-25 vr 12:33>
:END:
...Some description...
#+END

I have all habits in a file habits.org which is part of the
'org-agenda-files' list.

When editing entries in the habits.org file, for example changing the
header, emacs CPU using goes to 100% and every keystroke takes 5-10
seconds.  

Apparently the long list of logbook entries is making
org-mode do a lot of work.  If I remove the logbook entries from a
header, editing it becomes fast again 

I've run elp-instrument-package and the top lines in the results were:
(while entering some text in the heading)

Function name                   Call Count  Elapsed Time  Average Time
----------------------------------------------------------------------
org-self-insert-command         24          102.20533396  4.2585555817
org-indent-refresh-maybe        96          102.19307239  1.0645111708
org-indent-add-properties       96          102.14709837  1.0640322747
org-at-item-p                   49728       99.277038295  0.0019964011
org-list-in-valid-context-p     48768       98.348947434  0.0020166696
org-in-block-p                  48768       98.188771636  0.0020133852
org-fix-tags-on-the-fly         24          76.427716178  3.1844881740
org-align-tags-here             24          76.427226749  3.1844677812
org-between-regexps-p           438912      74.150505545  0.0001689416
org-at-regexp-p                 438912      3.2884631479  7.492...e-06
org-list-item-body-column       48768       1.3817966130  2.833...e-05
org-item-re                     49728       0.1814685910  3.649...e-06
org-get-indentation             960         0.1036291090  0.0001079469

Is there anything I can do to improve performance. If possible I'd
like to keep the logbook entries in the same file as the habits.

Thanks,

marcel
-- 
Marcel van der Boom  -- http://hsdev.com/mvdb.vcf
HS-Development BV    -- http://www.hsdev.com
We use bitcoin!      -- http://bitcoin.org

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

* Re: Logbook drawer entries make editing very slow
  2013-02-20  8:03 Logbook drawer entries make editing very slow Marcel van der Boom
@ 2013-04-18 10:56 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2013-04-18 10:56 UTC (permalink / raw)
  To: Marcel van der Boom; +Cc: emacs-orgmode

Hi Marcel,

Marcel van der Boom <marcel@hsdev.com> writes:

> I'm using habit-style items a lot in my 'org' routine. A typical entry
> would look like this:
>
> #+BEGIN_SRC org
> *** TODO Do something daily                                                     
> SCHEDULED: <2013-02-20 wo .+1d>
> :LOGBOOK:
> - State "DONE"       from "TODO"       [2013-02-19 di 14:01]
> - State "DONE"       from "TODO"       [2013-02-17 zo 12:39]
> ...
> [lots of entries here]
> ...
> - State "DONE"       from "TODO"       [2010-02-25 Thu 13:51]
> - State "DONE"       from "TODO"       [2010-02-10 Wed 15:19]
> :END:
> :PROPERTIES:
> :STYLE: habit
> :LAST_REPEAT: [2013-02-19 di 14:01]
> :CREATED: <2011-03-25 vr 12:33>
> :END:
> ...Some description...
> #+END
>
> I have all habits in a file habits.org which is part of the
> 'org-agenda-files' list.
>
> When editing entries in the habits.org file, for example changing the
> header, emacs CPU using goes to 100% and every keystroke takes 5-10
> seconds.  

(org-at-item-p) can be very expensive, because it calls
(org-list-in-valid-context-p) which is also expensive and
clearly not optimized for every list movements.

I found out that the use is still acceptable for 1000-2000
list items, so I won't fix this right now, but something to
keep under the radar, yes.

In the meantime, cleaning out the logs sometimes is the only
suggestion I can make.

Thanks for reporting this,

-- 
 Bastien

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

end of thread, other threads:[~2013-04-18 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-20  8:03 Logbook drawer entries make editing very slow Marcel van der Boom
2013-04-18 10:56 ` Bastien

Code repositories for project(s) associated with this 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).