emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: =?utf-8?Q?Peter_M=C3=BCnster?= <pmlists@free.fr>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: notifications for todo items
Date: Sun, 26 Feb 2012 00:04:59 -0500	[thread overview]
Message-ID: <18201.1330232699@alphaville> (raw)
In-Reply-To: Message from =?utf-8?Q?Peter_M=C3=BCnster?= <pmlists@free.fr> of "Sun\, 26 Feb 2012 01\:09\:03 +0100." <87k43a5ucg.fsf@micropit.couberia.bzh>

Peter Münster <pmlists@free.fr> wrote:

> On Sat, Feb 25 2012, Nick Dokos wrote:
> 
> > A quick first impression: orgntf-process seems expensive. It seems
> > to take 100% of one core (I've got a quad-core processor) for three or
> > four seconds every fifty seconds. Unfortunately, the core is the same one
> > that's running emacs, so emacs stops responding for those three or four
> > seconds. I have disabled org-notify for now.
> 
> How many lines do you have in your org-files?
> (I've about 200 and execution time is about 100ms.)
> 
> I call now "(org-element-parse-buffer 'heading)", I hope it's faster for
> you. Is it faster, when the file is byte-compiled?
> 
> Other ideas:
> - I could divide orgntf-process into several tasks, so that things run
>   more smoothly.
> - You could call (org-notify-start -60), so the process will be called,
>   when idle for one minute.
> 
> The file has a new home: https://github.com/p-m/org-notify
> There is now `orgntf-verbose' to see execution time of
> `orgntf-todo-list'.
> 
> Thanks for testing!

Profiling results after byte compiling both org-notify.el and org-element.el
(the rest of org is uncompiled code):

,----
| org-element-parse-elements                                    891         3.8462059999  0.0043167295
| orgntf-process                                                1           1.594772      1.594772
| orgntf-time-measure                                           1           1.594763      1.594763
| orgntf-todo-list                                              1           1.59444       1.59444
| org-element-parse-buffer                                      15          1.5755259999  0.1050350666
| org-element-current-element                                   876         1.5125120000  0.0017266118
| org-element-headline-parser                                   876         1.4775100000  0.0016866552
| org-entry-properties                                          1752        0.7201820000  0.0004110627
| org-element-parse-secondary-string                            876         0.4682000000  0.0005344748
| org-element-parse-objects                                     942         0.4317159999  0.0004582972
| org-element-get-next-object-candidates                        1151        0.4044249999  0.0003513683
| org-back-to-heading                                           3504        0.1251230000  3.570...e-05
| org-element-time-stamp-successor                              969         0.1206909999  0.0001245521
| org-heading-components                                        876         0.0532400000  6.077...e-05
| org-element-latex-or-entity-successor                         1884        0.0469810000  2.493...e-05
| org-end-of-subtree                                            876         0.0365460000  4.171...e-05
| org-match-string-no-properties                                4167        0.0302490000  7.259...e-06
| org-element-link-successor                                    998         0.0220160000  2.206...e-05
| org-get-limited-outline-regexp                                1676        0.0199100000  1.187...e-05
| org-element-sub/superscript-successor                         953         0.0132220000  1.387...e-05
| org-truely-invisible-p                                        876         0.0127170000  1.451...e-05
| org-get-property-block                                        876         0.0118430000  1.351...e-05
| org-element-map                                               15          0.010387      0.0006924666
| org-element-inline-src-block-successor                        942         0.0066240000  7.031...e-06
| org-element-text-markup-successor                             942         0.0061229999  6.499...e-06
| org-at-heading-p                                              1767        0.0058330000  3.301...e-06
| org-element-macro-successor                                   876         0.0053859999  6.148...e-06
| org-get-category                                              1752        0.0051480000  2.938...e-06
| org-element-link-parser                                       63          0.0046710000  7.414...e-05
| org-element-inline-babel-call-successor                       942         0.0045489999  4.829...e-06
| org-element-statistics-cookie-successor                       922         0.0031339999  3.399...e-06
| org-refresh-category-properties                               10          0.0029679999  0.0002967999
| org-element-property                                          5073        0.0028890000  5.694...e-07
| org-skip-whitespace                                           891         0.0027629999  3.101...e-06
| org-element-radio-target-successor                            876         0.0026729999  3.051...e-06
| org-outline-level                                             876         0.0018010000  2.055...e-06
| org-element-time-stamp-parser                                 93          0.0016429999  1.766...e-05
| orgntf-make-todo                                              876         0.0015790000  1.802...e-06
| org-agenda-files                                              1           0.001418      0.001418
| org-link-unescape                                             59          0.001049      1.777...e-05
| org-element-type                                              1752        0.0009170000  5.234...e-07
| org-reduced-level                                             876         0.0006700000  7.648...e-07
| org-link-expand-abbrev                                        59          0.0004410000  7.474...e-06
| org-link-unescape-compound                                    23          0.0003170000  1.378...e-05
| org-element-contents                                          891         0.0002970000  3.333...e-07
| org-trim                                                      53          0.000235      4.433...e-06
| org-element-statistics-cookie-parser                          46          0.0001809999  3.934...e-06
| org-float-time                                                2           0.000103      5.15e-05
| org-element-subscript-parser                                  7           6.3e-05       9e-06
| org-char-to-string                                            23          1.800...e-05  7.826...e-07
| org-no-properties                                             11          1.6e-05       1.454...e-06
`----


So orgntf-todo-list takes the lion's share of the time but
most of it is the 15 calls to org-element-parse-buffer (I have
15 files in my org-agenda-files list).

BTW, I think the first line of the profile must be a remnant
from before, although I did do an elp-reset-all.

Nick

  parent reply	other threads:[~2012-02-26  5:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22 23:38 notifications for todo items Peter Münster
2012-02-23  1:28 ` Nick Dokos
2012-02-23  8:36   ` Peter Münster
2012-02-23  9:06     ` Nick Dokos
2012-02-25  0:08     ` Nick Dokos
2012-02-26  0:09       ` Peter Münster
2012-02-26  2:45         ` Nick Dokos
2012-02-26  5:04         ` Nick Dokos [this message]
2012-02-26 14:06           ` optimisation of org-notify (was: notifications for todo items) Peter Münster
2012-03-04 23:37             ` optimisation of org-notify Peter Münster
2012-02-26  9:33         ` notifications for todo items Nicolas Goaziou
2012-02-26 14:07           ` Peter Münster

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=18201.1330232699@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=pmlists@free.fr \
    /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 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).