Peter Münster <pmli...@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

Reply via email to