* problem interaction between jinx-mode and org mode
@ 2023-04-06 11:29 Fraga, Eric
2023-04-06 12:04 ` Ihor Radchenko
0 siblings, 1 reply; 3+ messages in thread
From: Fraga, Eric @ 2023-04-06 11:29 UTC (permalink / raw)
To: Emacs Org mode mailing list
Hello all,
I have just posted an issue on the jinx spell checking package's github
site:
https://github.com/minad/jinx/issues/35
There seems to be a strange interaction between jinx and orgmode when
the buffer has lines of the form:
--8<---------------cut here---------------start------------->8---
┌ Debug: Placing hot node
│ node = n29
└ @ HeatExchangerNetworkDesign ~/s/research/julia/HeatExchangerNetworkDesign/src/HeatExchangerNetworkDesign.jl:1102
┌ Debug: Layout for node
│ node = n18
│ y = 6
└ @ HeatExchangerNetworkDesign
--8<---------------cut here---------------end--------------->8---
lines which are the output of Julia's @debug macro, whose output uses
non-ASCII Unicode characters at the start of each line. Emacs
essentially freezes for some seconds (10-20) every time I scroll (which
makes sense because jinx only spell-checks the visible part of the
buffer).
The profiler output for CPU:
--8<---------------cut here---------------start------------->8---
47871 96% - jinx--check-pending
47869 96% - jinx--check-region
47861 96% - jinx--flyspell-ignored-p
47861 96% - org-mode-flyspell-verify
47837 96% - org--flyspell-object-check-p
47837 96% - org-element-context
46973 94% - org-element--object-lex
46022 92% - org-element-code-parser
340 0% - org-element--parse-generic-emphasis
328 0% + rx-to-string
859 1% + org-element-italic-parser
--8<---------------cut here---------------end--------------->8---
and MEM:
--8<---------------cut here---------------start------------->8---
326,775,960 96% - timer-event-handler
326,674,976 96% - apply
325,996,129 96% - jinx--timer-handler
325,678,345 95% - jinx--check-pending
325,657,281 95% - jinx--check-region
325,636,601 95% - jinx--flyspell-ignored-p
325,636,601 95% - org-mode-flyspell-verify
325,072,246 95% - org--flyspell-object-check-p
325,072,246 95% - org-element-context
325,026,076 95% - org-element--object-lex
215,616,248 63% - org-element-italic-parser
211,670,968 62% - org-element--parse-generic-emphasis
211,670,968 62% - rx-to-string
186,054,064 54% - rx--translate
186,054,064 54% - rx--translate-form
181,758,312 53% - rx--translate-seq
155,393,544 45% - rx--translate
155,393,544 45% - rx--translate-form
107,261,576 31% - rx--translate-or
100,408,048 29% - mapcan
99,194,744 29% + #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_2>
2,524,984 0% rx--translate
45,311,856 13% + rx--translate-not
8,427,544 2% + rx--sequence
10,559,024 3% + rx--atomic-regexp
83,089,056 24% + org-element-code-parser
4,458,332 1% + org-element-verbatim-parser
342,616 0% + org-log-into-drawer
--8<---------------cut here---------------end--------------->8---
Turning off jinx-mode in the org buffer restores normal behaviour.
I've not yet tried with emacs -Q, however, so it could be something in
my configuration... However, I do wonder whether it is the file name use
of "~" that may be causing problems with the rx?
Thank you,
eric
--
: Eric S Fraga, with org release_9.6.1-341-g614b96 in Emacs 30.0.50
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: problem interaction between jinx-mode and org mode
2023-04-06 11:29 problem interaction between jinx-mode and org mode Fraga, Eric
@ 2023-04-06 12:04 ` Ihor Radchenko
2023-04-06 15:33 ` Fraga, Eric
0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2023-04-06 12:04 UTC (permalink / raw)
To: Fraga, Eric; +Cc: Emacs Org mode mailing list
"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
> --8<---------------cut here---------------start------------->8---
> ┌ Debug: Placing hot node
> │ node = n29
> └ @ HeatExchangerNetworkDesign
> ~/s/research/julia/HeatExchangerNetworkDesign/src/HeatExchangerNetworkDesign.jl:1102
> ┌ Debug: Layout for node
> │ node = n18
> │ y = 6
> └ @ HeatExchangerNetworkDesign
> --8<---------------cut here---------------end--------------->8---
This is one long paragraph containing ~..., which is matching a possible
~code~ markup. org-element-code-parser tries to search the matching the
closing "~", running regexp search until the end of the paragraph.
> The profiler output for CPU:
>
> --8<---------------cut here---------------start------------->8---
> 47871 96% - jinx--check-pending
> 47869 96% - jinx--check-region
> 47861 96% - jinx--flyspell-ignored-p
> 47861 96% - org-mode-flyspell-verify
> 47837 96% - org--flyspell-object-check-p
> 47837 96% - org-element-context
> 46973 94% - org-element--object-lex
> 46022 92% - org-element-code-parser
So, jinx--check-region is triggering org-element-context on every single
word. This will run regexp search N_words times, making Emacs do regexp
search until the end of the paragraph each time.
In the absence of object cache, this is indeed slow.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: problem interaction between jinx-mode and org mode
2023-04-06 12:04 ` Ihor Radchenko
@ 2023-04-06 15:33 ` Fraga, Eric
0 siblings, 0 replies; 3+ messages in thread
From: Fraga, Eric @ 2023-04-06 15:33 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Emacs Org mode mailing list
Hello Ihor,
On Thursday, 6 Apr 2023 at 12:04, Ihor Radchenko wrote:
> This is one long paragraph containing ~..., which is matching a possible
> ~code~ markup. org-element-code-parser tries to search the matching the
> closing "~", running regexp search until the end of the paragraph.
Thank you for confirming my guess. Knowing this, I can work around this
in a number of ways but it did catch me by surprise!
Thanks for getting back quickly.
eric
--
: Eric S Fraga, with org release_9.6.1-341-g614b96 in Emacs 30.0.50
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-06 15:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-06 11:29 problem interaction between jinx-mode and org mode Fraga, Eric
2023-04-06 12:04 ` Ihor Radchenko
2023-04-06 15:33 ` Fraga, Eric
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).