Re: [O] faster agenda with properties support disabled (no org-refresh-properties)

2013-09-03 Thread Carsten Dominik

On Sep 3, 2013, at 2:02 PM, Daniel Clemente  wrote:

> 
> Thank you.
>  With this on, I reduced 1'7 seconds my normal agenda time (C-a a), from 13'5 
> to 11'8. Numbers are from elp but I checked them with an external stopwatch 
> because sometimes I have the impression that elp makes things slower.
>  The strange thing is, I don't see the difference I saw days before in 
> (org-batch-agenda). I could reproduceably run a slow export (with no patch) 
> and a fast export (with the patch). Now both are fast. I suppose that the 
> contents of my agenda might have changed in a way that is fast to handle. 
> Anyway, this is only good.

OK, I also have no idea why that happens.

Thanks for the feedback.

- Carsten

> 
> El Sat, 31 Aug 2013 07:58:00 +0200 Carsten Dominik va escriure:
>> 
>> Hi Daniel,
>> 
>> I have implemented a different version of the patch.  Please take a look at 
>> the new variable
>> org-agenda-ignore-drawer-properties.
>> 
>> Regards, and thanks!
>> 
>> - Carsten
>> 
>> On 23.8.2013, at 11:24, Daniel Clemente  wrote:
>> 
> So I would like to ask: is there a clean way to disable calls to
> org-refresh-properties?
 
 No, that would require a patch and a config variable.
 
 - Carsten
 
>>> 
>>> I send a patch to do this. Setting this new variable to t reduced 10
>>> seconds my agenda export time (down from 1 minute 6 seconds) as well
>>> as the update.
>>> You may add a comment about what to expect if your agenda depends on
>>> property data.
>>> 
>>> 
>>> diff --git a/lisp/org.el b/lisp/org.el
>>> index 572b797..167e7a8 100644
>>> --- a/lisp/org.el
>>> +++ b/lisp/org.el
>>> @@ -17656,6 +17656,14 @@ is not set, the tables are not re-aligned, etc."
>>>  :version "24.3"
>>>  :group 'org-agenda)
>>> 
>>> +(defcustom org-agenda-ignore-properties nil
>>> +  "Avoid updating text properties when building the agenda.
>>> +Properties are used for effort estimation, appointments, categories.
>>> +If you don't use these in the agenda, set it to t and it will be faster."
>>> +  :type 'boolean
>>> +  :version "24.3"
>>> +  :group 'org-agenda)
>>> +
>>> (defun org-duration-string-to-minutes (s &optional output-to-string)
>>>  "Convert a duration string S to minutes.
>>> 
>>> @@ -18017,9 +18025,11 @@ When a buffer is unmodified, it is just
>>> killed.  When modified, it is saved
>>> ;; this is only run for setting agenda tags from setup
>>> ;; file
>>> (org-set-regexps-and-options)))
>>> -   (org-refresh-category-properties)
>>> -   (org-refresh-properties org-effort-property 'org-effort)
>>> -   (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
>>> +   (unless org-agenda-ignore-properties
>>> + (org-refresh-category-properties)
>>> + (org-refresh-properties org-effort-property 'org-effort)
>>> + (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
>>> +   )
>>> (setq org-todo-keywords-for-agenda
>>>   (append org-todo-keywords-for-agenda org-todo-keywords-1))
>>> (setq org-done-keywords-for-agenda
>>> 
>> 




Re: [O] faster agenda with properties support disabled (no org-refresh-properties)

2013-09-03 Thread Daniel Clemente

Thank you.
  With this on, I reduced 1'7 seconds my normal agenda time (C-a a), from 13'5 
to 11'8. Numbers are from elp but I checked them with an external stopwatch 
because sometimes I have the impression that elp makes things slower.
  The strange thing is, I don't see the difference I saw days before in 
(org-batch-agenda). I could reproduceably run a slow export (with no patch) and 
a fast export (with the patch). Now both are fast. I suppose that the contents 
of my agenda might have changed in a way that is fast to handle. Anyway, this 
is only good.

El Sat, 31 Aug 2013 07:58:00 +0200 Carsten Dominik va escriure:
> 
> Hi Daniel,
> 
> I have implemented a different version of the patch.  Please take a look at 
> the new variable
> org-agenda-ignore-drawer-properties.
> 
> Regards, and thanks!
> 
> - Carsten
> 
> On 23.8.2013, at 11:24, Daniel Clemente  wrote:
> 
> >>> So I would like to ask: is there a clean way to disable calls to
> >>> org-refresh-properties?
> >> 
> >> No, that would require a patch and a config variable.
> >> 
> >> - Carsten
> >> 
> > 
> >  I send a patch to do this. Setting this new variable to t reduced 10
> > seconds my agenda export time (down from 1 minute 6 seconds) as well
> > as the update.
> >  You may add a comment about what to expect if your agenda depends on
> > property data.
> > 
> > 
> > diff --git a/lisp/org.el b/lisp/org.el
> > index 572b797..167e7a8 100644
> > --- a/lisp/org.el
> > +++ b/lisp/org.el
> > @@ -17656,6 +17656,14 @@ is not set, the tables are not re-aligned, etc."
> >   :version "24.3"
> >   :group 'org-agenda)
> > 
> > +(defcustom org-agenda-ignore-properties nil
> > +  "Avoid updating text properties when building the agenda.
> > +Properties are used for effort estimation, appointments, categories.
> > +If you don't use these in the agenda, set it to t and it will be faster."
> > +  :type 'boolean
> > +  :version "24.3"
> > +  :group 'org-agenda)
> > +
> > (defun org-duration-string-to-minutes (s &optional output-to-string)
> >   "Convert a duration string S to minutes.
> > 
> > @@ -18017,9 +18025,11 @@ When a buffer is unmodified, it is just
> > killed.  When modified, it is saved
> > ;; this is only run for setting agenda tags from setup
> > ;; file
> > (org-set-regexps-and-options)))
> > -   (org-refresh-category-properties)
> > -   (org-refresh-properties org-effort-property 'org-effort)
> > -   (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
> > +   (unless org-agenda-ignore-properties
> > + (org-refresh-category-properties)
> > + (org-refresh-properties org-effort-property 'org-effort)
> > + (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
> > +   )
> > (setq org-todo-keywords-for-agenda
> >   (append org-todo-keywords-for-agenda org-todo-keywords-1))
> > (setq org-done-keywords-for-agenda
> > 
> 



Re: [O] faster agenda with properties support disabled (no org-refresh-properties)

2013-09-02 Thread Bastien
Carsten Dominik  writes:

>> Great -- could someone document this on this page?
>> http://orgmode.org/worg/agenda-optimization.html
>
> Done.

Thanks!

-- 
 Bastien



Re: [O] faster agenda with properties support disabled (no org-refresh-properties)

2013-09-01 Thread Carsten Dominik

On 31.8.2013, at 08:22, Bastien  wrote:

> Hi all,
> 
> Carsten Dominik  writes:
> 
>> I have implemented a different version of the patch.  Please take a look at 
>> the new variable
>> org-agenda-ignore-drawer-properties.
> 
> Great -- could someone document this on this page?
> http://orgmode.org/worg/agenda-optimization.html

Done.

- Carsten

> 
> Thanks!
> 
> -- 
> Bastien




Re: [O] faster agenda with properties support disabled (no org-refresh-properties)

2013-08-30 Thread Bastien
Hi all,

Carsten Dominik  writes:

> I have implemented a different version of the patch.  Please take a look at 
> the new variable
> org-agenda-ignore-drawer-properties.

Great -- could someone document this on this page?
http://orgmode.org/worg/agenda-optimization.html

Thanks!

-- 
 Bastien



Re: [O] faster agenda with properties support disabled (no org-refresh-properties)

2013-08-30 Thread Carsten Dominik
Hi Daniel,

I have implemented a different version of the patch.  Please take a look at the 
new variable
org-agenda-ignore-drawer-properties.

Regards, and thanks!

- Carsten

On 23.8.2013, at 11:24, Daniel Clemente  wrote:

>>> So I would like to ask: is there a clean way to disable calls to
>>> org-refresh-properties?
>> 
>> No, that would require a patch and a config variable.
>> 
>> - Carsten
>> 
> 
>  I send a patch to do this. Setting this new variable to t reduced 10
> seconds my agenda export time (down from 1 minute 6 seconds) as well
> as the update.
>  You may add a comment about what to expect if your agenda depends on
> property data.
> 
> 
> diff --git a/lisp/org.el b/lisp/org.el
> index 572b797..167e7a8 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -17656,6 +17656,14 @@ is not set, the tables are not re-aligned, etc."
>   :version "24.3"
>   :group 'org-agenda)
> 
> +(defcustom org-agenda-ignore-properties nil
> +  "Avoid updating text properties when building the agenda.
> +Properties are used for effort estimation, appointments, categories.
> +If you don't use these in the agenda, set it to t and it will be faster."
> +  :type 'boolean
> +  :version "24.3"
> +  :group 'org-agenda)
> +
> (defun org-duration-string-to-minutes (s &optional output-to-string)
>   "Convert a duration string S to minutes.
> 
> @@ -18017,9 +18025,11 @@ When a buffer is unmodified, it is just
> killed.  When modified, it is saved
>   ;; this is only run for setting agenda tags from setup
>   ;; file
>   (org-set-regexps-and-options)))
> - (org-refresh-category-properties)
> - (org-refresh-properties org-effort-property 'org-effort)
> - (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
> + (unless org-agenda-ignore-properties
> +   (org-refresh-category-properties)
> +   (org-refresh-properties org-effort-property 'org-effort)
> +   (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
> + )
>   (setq org-todo-keywords-for-agenda
> (append org-todo-keywords-for-agenda org-todo-keywords-1))
>   (setq org-done-keywords-for-agenda
> 




Re: [O] faster agenda with properties support disabled (no org-refresh-properties)

2013-08-28 Thread Daniel Clemente

The speedup was 66 → 56 seconds (not to 10, but by 10) when exporting the 
agenda. It's small but noticeable.
I don't use :CATEGORY: but I'm using category icons 
(org-agenda-category-icon-alist) and I keep seeing them, so I assume categories 
are still shown. You can try it in your files to see what happens.

El Tue, 27 Aug 2013 21:28:27 -0700 Samuel Wales va escriure:
> 
> Probably the only property most people use most of the time in the
> agenda is category.  Would this get rid of showing category too?  66s
> to 10s is impressive.  I'd give up sorting and selecting category for
> that.  But I wouldn't give up showing category.
> 
> Samuel



Re: [O] faster agenda with properties support disabled (no org-refresh-properties)

2013-08-27 Thread Samuel Wales
Probably the only property most people use most of the time in the
agenda is category.  Would this get rid of showing category too?  66s
to 10s is impressive.  I'd give up sorting and selecting category for
that.  But I wouldn't give up showing category.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] faster agenda with properties support disabled (no org-refresh-properties)

2013-08-23 Thread Daniel Clemente
>>  So I would like to ask: is there a clean way to disable calls to
>> org-refresh-properties?
>
> No, that would require a patch and a config variable.
>
> - Carsten
>

  I send a patch to do this. Setting this new variable to t reduced 10
seconds my agenda export time (down from 1 minute 6 seconds) as well
as the update.
  You may add a comment about what to expect if your agenda depends on
property data.


diff --git a/lisp/org.el b/lisp/org.el
index 572b797..167e7a8 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17656,6 +17656,14 @@ is not set, the tables are not re-aligned, etc."
   :version "24.3"
   :group 'org-agenda)

+(defcustom org-agenda-ignore-properties nil
+  "Avoid updating text properties when building the agenda.
+Properties are used for effort estimation, appointments, categories.
+If you don't use these in the agenda, set it to t and it will be faster."
+  :type 'boolean
+  :version "24.3"
+  :group 'org-agenda)
+
 (defun org-duration-string-to-minutes (s &optional output-to-string)
   "Convert a duration string S to minutes.

@@ -18017,9 +18025,11 @@ When a buffer is unmodified, it is just
killed.  When modified, it is saved
;; this is only run for setting agenda tags from setup
;; file
(org-set-regexps-and-options)))
-   (org-refresh-category-properties)
-   (org-refresh-properties org-effort-property 'org-effort)
-   (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
+   (unless org-agenda-ignore-properties
+ (org-refresh-category-properties)
+ (org-refresh-properties org-effort-property 'org-effort)
+ (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
+   )
(setq org-todo-keywords-for-agenda
  (append org-todo-keywords-for-agenda org-todo-keywords-1))
(setq org-done-keywords-for-agenda



Re: [O] faster agenda with properties support disabled (no org-refresh-properties)

2013-08-11 Thread Carsten Dominik

On 12.8.2013, at 05:43, Daniel Clemente  wrote:

> 
>> 
>> M-x elp-instrument-package org
>> M-x elp-reset-all
>> 
>> M-x elp-results
> 
>  Incidentally I ran that and I saw:
> 
> org-agenda1   
> 15.709354028  15.709354028
> org-agenda-list   1   
> 15.495628529  15.495628529
> org-agenda-prepare1   
> 8.388162561   8.388162561
> org-agenda-prepare-buffers1   
> 8.349513929   8.349513929
> org-agenda-get-day-entries477 
> 5.7457141640  0.0120455223
> org-agenda-get-scheduled  477 
> 2.0763930930  0.0043530253
> org-agenda-get-timestamps 477 
> 2.046089454   0.0042894957
> org-set-regexps-and-options-for-tags  164 
> 1.8202055340  0.0110988142
> org-refresh-properties318 
> 1.3865960840  0.0043603650
> org-refresh-category-properties   159 
> 1.1616332550  0.0073058695
> org-agenda-get-deadlines  477 
> 0.5512838650  0.0011557313
> org-agenda-get-blocks 477 
> 0.5356222019  0.0011228976
> org-get-todo-state3581
> 0.4114158859  0.0001148885
> org-agenda-get-sexps  477 
> 0.4037585499  0.0008464539
> …
> 
>  I looked at org-refresh-properties.
> 
>  In org.el there is:
> 
> (defun org-agenda-prepare-buffers (files)
> …
>   (org-refresh-category-properties)
>   (org-refresh-properties org-effort-property 'org-effort)
>   (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
> …
> 
>  Since I am not using effort/category/appointment properties in my agenda, I 
> would like to disable it. I commented it in the code and I get the same 
> agenda but 2'4 seconds faster (even more than 1'4 from 
> org-refresh-properties). The new instrumentation report is:
> 
> org-agenda1   
> 13.345656663  13.345656663
> org-agenda-list   1   
> 13.113396681  13.113396681
> org-agenda-prepare1   
> 7.086576653   7.086576653
> org-agenda-prepare-buffers1   
> 7.054057855   7.054057855
> org-agenda-get-day-entries477 
> 5.7340928759  0.0120211590
> org-agenda-get-scheduled  477 
> 3.3844209709  0.0070952221
> org-set-regexps-and-options-for-tags  164 
> 1.8059163709  0.0110116851
> org-refresh-properties318 
> 1.3982702620  0.0043970762
> org-refresh-category-properties   159 
> 1.1513761240  0.0072413592
> org-agenda-get-timestamps 477 
> 0.6975214329  0.0014623090
> org-agenda-get-deadlines  477 
> 0.557952655   0.0011697120
> org-agenda-get-blocks 477 
> 0.533165758   0.0011177479
> org-agenda-skip   3977
> 0.4244523499  0.0001067267
> …
> 
>  So I would like to ask: is there a clean way to disable calls to 
> org-refresh-properties?

No, that would require a patch and a config variable.

- Carsten

> 
> 




[O] faster agenda with properties support disabled (no org-refresh-properties)

2013-08-11 Thread Daniel Clemente

> 
> M-x elp-instrument-package org
> M-x elp-reset-all
> 
> M-x elp-results

  Incidentally I ran that and I saw:

org-agenda1   
15.709354028  15.709354028
org-agenda-list   1   
15.495628529  15.495628529
org-agenda-prepare1   
8.388162561   8.388162561
org-agenda-prepare-buffers1   
8.349513929   8.349513929
org-agenda-get-day-entries477 
5.7457141640  0.0120455223
org-agenda-get-scheduled  477 
2.0763930930  0.0043530253
org-agenda-get-timestamps 477 
2.046089454   0.0042894957
org-set-regexps-and-options-for-tags  164 
1.8202055340  0.0110988142
org-refresh-properties318 
1.3865960840  0.0043603650
org-refresh-category-properties   159 
1.1616332550  0.0073058695
org-agenda-get-deadlines  477 
0.5512838650  0.0011557313
org-agenda-get-blocks 477 
0.5356222019  0.0011228976
org-get-todo-state3581
0.4114158859  0.0001148885
org-agenda-get-sexps  477 
0.4037585499  0.0008464539
…

  I looked at org-refresh-properties.

  In org.el there is:

(defun org-agenda-prepare-buffers (files)
…
(org-refresh-category-properties)
(org-refresh-properties org-effort-property 'org-effort)
(org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
…

  Since I am not using effort/category/appointment properties in my agenda, I 
would like to disable it. I commented it in the code and I get the same agenda 
but 2'4 seconds faster (even more than 1'4 from org-refresh-properties). The 
new instrumentation report is:

org-agenda1   
13.345656663  13.345656663
org-agenda-list   1   
13.113396681  13.113396681
org-agenda-prepare1   
7.086576653   7.086576653
org-agenda-prepare-buffers1   
7.054057855   7.054057855
org-agenda-get-day-entries477 
5.7340928759  0.0120211590
org-agenda-get-scheduled  477 
3.3844209709  0.0070952221
org-set-regexps-and-options-for-tags  164 
1.8059163709  0.0110116851
org-refresh-properties318 
1.3982702620  0.0043970762
org-refresh-category-properties   159 
1.1513761240  0.0072413592
org-agenda-get-timestamps 477 
0.6975214329  0.0014623090
org-agenda-get-deadlines  477 
0.557952655   0.0011697120
org-agenda-get-blocks 477 
0.533165758   0.0011177479
org-agenda-skip   3977
0.4244523499  0.0001067267
…

  So I would like to ask: is there a clean way to disable calls to 
org-refresh-properties?