Re: [O] C-c C-c in table takes 12 seconds

2014-11-23 Thread Bernt Hansen
Karl Voit  writes:

> * Nicolas Goaziou  wrote:
>> Hello,
>
> Hi!
>
>> Could you provide an ECM? I'm unable to reproduce it.
>
> Yeah, I can do that. However, because I never did this before and I
> suppose this is going to take me at least two hours, I will post it
> whenever I got time to do the ECM.
>
> Is this correct that for an ECM I have to provide a complete
> (minimal) init.el and Org-mode files?

Hi Karl,

In case it is useful here is what I use for ECMs (I haven't done one in
well over a year though)

This is on my Linux system:

Shell script to start emacs with a minimal setup
,[ minimal-emacs ]
| #!/bin/sh
| TESTEL=
| TESTFILE=/tmp/test.el
| if test -e $TESTFILE
| then
|   TESTEL="-l /tmp/test.el"
| fi
| emacs -q -l ~/minimal.emacs $TESTEL $1
`

Minimal .emacs file to enable org-mode from git
,[ minimal.emacs ]
| (add-to-list 'load-path "~/git/org-mode/lisp/")
| ;(add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
| (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . 
org-mode))
| (require 'org)
| 
| (global-set-key "\C-cl" 'org-store-link)
| (global-set-key "\C-ca" 'org-agenda)
| (global-set-key "\C-cb" 'org-iswitchb)
`

I put test settings that show the problem in /tmp/test.el which is
automatically included when I run 'minimal-emacs'.

Hope that helps.

Regards,
Bernt



Re: [O] C-c C-c in table takes 12 seconds

2014-11-23 Thread Nicolas Goaziou
Rasmus  writes:

> Is there a way to "reset" the cache?  To get out of the bad state.

M-x org-element-cache-reset

Regards,



Re: [O] C-c C-c in table takes 12 seconds

2014-11-23 Thread Rasmus
Hi,

Nicolas Goaziou  writes:

> Rasmus  writes:
>
>> When looking at the profiler, I notice avl-tree--do-delete (and other
>> avl functions) and org-element--cache-compare taking lots of speed.  I
>> think I have also had this issues in mail-buffers where I use orgstruct
>> modes.  Again org-element--cache showed up.
>
> It means the cache is corrupted. Alas, it doesn't explain how it get
> into that state.

Is there a way to "reset" the cache?  To get out of the bad state.

>> Attached is a backtrace from yesterday where I had to stop Emacs with
>> kill -usr2.  The file I was working on has many tables with conjugations
>> of words and some entities.
>
> Unfortunately, a backtrace isn't helpful in this case. I'd rather have
> a relatively small Org document where the problem is guaranteed to
> occur, and a bunch of commands possibly triggering it.

I'm have still not found a consistent receipt to reproduce this
state. . .  Today I have been editing the same file without expiring
issues.

—Rasmus

-- 
C is for Cookie




Re: [O] C-c C-c in table takes 12 seconds

2014-11-23 Thread Nicolas Goaziou
Hello,

Rasmus  writes:

> When looking at the profiler, I notice avl-tree--do-delete (and other
> avl functions) and org-element--cache-compare taking lots of speed.  I
> think I have also had this issues in mail-buffers where I use orgstruct
> modes.  Again org-element--cache showed up.

It means the cache is corrupted. Alas, it doesn't explain how it get
into that state.

> Attached is a backtrace from yesterday where I had to stop Emacs with
> kill -usr2.  The file I was working on has many tables with conjugations
> of words and some entities.

Unfortunately, a backtrace isn't helpful in this case. I'd rather have
a relatively small Org document where the problem is guaranteed to
occur, and a bunch of commands possibly triggering it.


Regards,

-- 
Nicolas Goaziou



Re: [O] C-c C-c in table takes 12 seconds

2014-11-23 Thread Karl Voit
* Nicolas Goaziou  wrote:
> Hello,

Hi!

> Could you provide an ECM? I'm unable to reproduce it.

Yeah, I can do that. However, because I never did this before and I
suppose this is going to take me at least two hours, I will post it
whenever I got time to do the ECM.

Is this correct that for an ECM I have to provide a complete
(minimal) init.el and Org-mode files?

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] C-c C-c in table takes 12 seconds

2014-11-23 Thread Nicolas Goaziou
Hello,

Karl Voit  writes:

>> Issue: Whenever I change table cells via TAB, it takes twelve
>> seconds with 100% CPU core:
>>
>> org-table-next-field very slow:
>> #+BEGIN_EXAMPLE
>> - command-execute   31397  99%
>>  - call-interactively   31397  99%
>>   - yas-expand  31298  98%
>>- yas--fallback  31298  98%
>> - call-interactively31298  98%
>>  - org-cycle31298  98%
>>   - call-interactively  31291  98%
>>- org-table-next-field   31291  98%
>> - org-table-align   15676  49%
>>  + org-activate-bracket-links  36   0%
>> [...]
>> #+END_EXAMPLE

Could you provide an ECM? I'm unable to reproduce it.

In fact I remember encountering issues using yasnippet within Org
tables, but never related to speed.


Regards,

-- 
Nicolas Goaziou



[O] C-c C-c in table takes 12 seconds (was: yasnippet and Org-mode)

2014-11-23 Thread Karl Voit
Hm. Maybe I wrongly suspected yasnippet:

* Karl Voit  wrote:
>
> Background with a specific issue:
>
> Issue: Whenever I change table cells via TAB, it takes twelve
> seconds with 100% CPU core:
>
> org-table-next-field very slow:
> #+BEGIN_EXAMPLE
> - command-execute   31397  99%
>  - call-interactively   31397  99%
>   - yas-expand  31298  98%
>- yas--fallback  31298  98%
> - call-interactively31298  98%
>  - org-cycle31298  98%
>   - call-interactively  31291  98%
>- org-table-next-field   31291  98%
> - org-table-align   15676  49%
>  + org-activate-bracket-links  36   0%
> [...]
> #+END_EXAMPLE
>
> In org-table-next-field I suspect the re-calculation process. And
> yes, also the simple ~C-c C-c~ on a table takes very long. Even
> within the primitive table "| |".
>
> Profiling the re-calculation ends up with:
> #+BEGIN_EXAMPLE
> - command-execute 43157  99%
>  - call-interactively 43157  99%
>   - yas-expand31871  73%
>- yas--fallback31871  73%
> - call-interactively  31871  73%
>  - org-cycle  31871  73%
>   - call-interactively31864  73%
>- org-table-next-field 31864  73%
> - org-table-align 15782  36%
>  - org-activate-bracket-links46   0%
> [...]
> #+END_EXAMPLE
>
> So I guess that yas-expand has a certain role in this drama.

Hm, I have to admit I forgot to test without yas-minor-mode (silly
me):

#+BEGIN_EXAMPLE
- command-execute  10993  99%
 - call-interactively  10993  99%
  - org-ctrl-c-ctrl-c  10905  99%
 org-table-align5450  49%
   + run-hook-with-args-until-success  6   0%
  + byte-code 34   0%
  + minibuffer-complete   26   0%
  + previous-line 18   0%
  + execute-extended-command  10   0%
+ timer-event-handler  6   0%
+ redisplay_internal (C function)  3   0%
+ ...  0   0%
#+END_EXAMPLE

Well, this does not involve yasnippet and also lasts too long :-(

How about this?

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github