emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] make test is extremely slow since b3cc2f793 [9.5.1 (9.5.1-g984367 @ /home/yantar92/.emacs.d/straight/build/org/)]
@ 2021-12-04  5:37 Ihor Radchenko
  2021-12-04 17:11 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2021-12-04  5:37 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I noticed that make test became extremely slow recently.
The first bottleneck can be seen in

make BTEST_RE="^test-org-cite/adjust-note" test

passed  1/1  test-org-cite/adjust-note (12.321278 sec)

The test takes 12sec!
Moreover, subsequent tests (even not related to org-cite) become slower,
presumably because we overuse Emacs memory.

I am not using org-cite much myself, but I imagine that ordinary users
may also suffer from a similar performance issues after multiple
exports.

The profiler report shows that org-cite-get-processor may be the cause:

        5794  91%                - ert-run-test
        5794  91%                 - ert--run-test-internal
        5794  91%                  - #<lambda 0x5c69d99ea013bd4>
        4813  75%                   - let
        4813  75%                    - let*
        4813  75%                     - condition-case
        4813  75%                      - let
        4813  75%                       - list
        4813  75%                        - cons
        4813  75%                         - mapcar
         516   8%                          - #<lambda -0xebdf3f4ac8552e7>
         516   8%                           + test-org-cite--export-with-rule
         497   7%                          - #<lambda -0xebde86ea74e52e7>
         497   7%                           + test-org-cite--export-with-rule
         417   6%                          - #<lambda -0xebdf3f4b1fe52e7>
         417   6%                           + test-org-cite--export-with-rule
         398   6%                          - #<lambda -0xebdfc57f09452e7>
         398   6%                           + test-org-cite--export-with-rule
         397   6%                          - #<lambda -0xebde86e9e4b52e7>
         397   6%                           + test-org-cite--export-with-rule
         393   6%                          - #<lambda -0xebdfc57ded652e7>
         393   6%                           + test-org-cite--export-with-rule
         389   6%                          - #<lambda -0xebdce06d12652e7>
         389   6%                           + test-org-cite--export-with-rule
         377   5%                          - #<lambda -0xebde86e96a852e7>
         377   5%                           + test-org-cite--export-with-rule
         377   5%                          - #<lambda -0xebde86e989552e7>
         377   5%                           + test-org-cite--export-with-rule
         368   5%                          - #<lambda -0xebdfc57f3d952e7>
         368   5%                           + test-org-cite--export-with-rule
         347   5%                          - #<lambda -0xebdce06cb7d52e7>
         347   5%                           + test-org-cite--export-with-rule
         337   5%                          - #<lambda -0xebdfc57f51352e7>
         337   5%                           + test-org-cite--export-with-rule
         981  15%                   - let*
         981  15%                    - condition-case
         981  15%                     - let
         981  15%                      - list
         981  15%                       - test-org-cite--export-with-rule
         981  15%                        - let
         981  15%                         - let
         981  15%                          - save-current-buffer
         981  15%                           - unwind-protect
         981  15%                            - progn
         942  14%                             - let
         942  14%                              - let
         942  14%                               - org-trim
         942  14%                                - org-export-as
         398   6%                                 - org-cite-store-export-processor
         224   3%                                  - org-cite-processor-has-capability-p
         224   3%                                     org-cite-get-processor
         174   2%                                    org-cite-get-processor
         232   3%                                 - org-cite-finalize-export
         232   3%                                    org-cite-get-processor
         214   3%                                 - org-cite-process-citations
         214   3%                                  - org-cite-export-citation
         214   3%                                     org-cite-get-processor
          30   0%                                 + org-export-copy-buffer
          29   0%                                 + org-babel-exp-process-buffer
          20   0%                                 + run-hook-with-args
          10   0%                                   org-set-regexps-and-options
           9   0%                                 + org-export-data
          20   0%                             + org-mode
          19   0%                             + font-lock-ensure
          62   0%                + #<compiled -0x15985ab8cfaa100a>
          20   0%                + #<compiled 0x1ebe2226a11f1053>

Best,
Ihor


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG] make test is extremely slow since b3cc2f793 [9.5.1 (9.5.1-g984367 @ /home/yantar92/.emacs.d/straight/build/org/)]
  2021-12-04  5:37 [BUG] make test is extremely slow since b3cc2f793 [9.5.1 (9.5.1-g984367 @ /home/yantar92/.emacs.d/straight/build/org/)] Ihor Radchenko
@ 2021-12-04 17:11 ` Nicolas Goaziou
  2021-12-05  3:53   ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2021-12-04 17:11 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hello,

Ihor Radchenko <yantar92@gmail.com> writes:

> I noticed that make test became extremely slow recently.
> The first bottleneck can be seen in
>
> make BTEST_RE="^test-org-cite/adjust-note" test
>
> passed  1/1  test-org-cite/adjust-note (12.321278 sec)
>
> The test takes 12sec!

Fixed. Thank you.

Regards,
-- 
Nicolas Goaziou


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG] make test is extremely slow since b3cc2f793 [9.5.1 (9.5.1-g984367 @ /home/yantar92/.emacs.d/straight/build/org/)]
  2021-12-04 17:11 ` Nicolas Goaziou
@ 2021-12-05  3:53   ` Ihor Radchenko
  2021-12-05  9:10     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2021-12-05  3:53 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

>> I noticed that make test became extremely slow recently.
>> The first bottleneck can be seen in
>>
>> make BTEST_RE="^test-org-cite/adjust-note" test
>>
>> passed  1/1  test-org-cite/adjust-note (12.321278 sec)
>>
>> The test takes 12sec!
>
> Fixed. Thank you.

Sorry, but tests are still slow for me after the update.
If I run the test from inside Emacs with ert, things got better, but
make BTEST_RE="^test-org-cite/adjust-note" test
still takes 12sec.

Best,
Ihor


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG] make test is extremely slow since b3cc2f793 [9.5.1 (9.5.1-g984367 @ /home/yantar92/.emacs.d/straight/build/org/)]
  2021-12-05  3:53   ` Ihor Radchenko
@ 2021-12-05  9:10     ` Nicolas Goaziou
  2021-12-06 14:01       ` Kaushal Modi
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2021-12-05  9:10 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hello,

Ihor Radchenko <yantar92@gmail.com> writes:

> Sorry, but tests are still slow for me after the update.
> If I run the test from inside Emacs with ert, things got better, but
> make BTEST_RE="^test-org-cite/adjust-note" test
> still takes 12sec.

I cannot reproduce it. The test went down from 4.5s to 1.5s. I am using
Emacs 27.2.

Regards,
-- 
Nicolas Goaziou


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG] make test is extremely slow since b3cc2f793 [9.5.1 (9.5.1-g984367 @ /home/yantar92/.emacs.d/straight/build/org/)]
  2021-12-05  9:10     ` Nicolas Goaziou
@ 2021-12-06 14:01       ` Kaushal Modi
  2021-12-06 14:43         ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Kaushal Modi @ 2021-12-06 14:01 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-org list, Ihor Radchenko

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

On Sun, Dec 5, 2021 at 4:12 AM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Ihor Radchenko <yantar92@gmail.com> writes:
>
> > Sorry, but tests are still slow for me after the update.
> > If I run the test from inside Emacs with ert, things got better, but
> > make BTEST_RE="^test-org-cite/adjust-note" test
> > still takes 12sec.
>
> I cannot reproduce it. The test went down from 4.5s to 1.5s. I am using
> Emacs 27.2.
>

Ihor,

FWIW, the tests runs in about the same time for me.

Running 1 tests (2021-12-06 08:59:31-0500, selector
‘"^test-org-cite/adjust-note"’)
   passed  1/1  test-org-cite/adjust-note (1.333928 sec)

I just rebuild Org from main branch and I am on emacs-28 branch built last
Friday:

Emacs version: GNU Emacs 28.0.90 (build 1, x86_64-pc-linux-gnu, GTK+
Version 3.22.30, cairo version 1.15.12)
 of 2021-12-03, built using commit 7282e492d5c3ed8c856d92a121d143f6a70db244.

Maybe strace would help identify a disk IO issue if any?

[-- Attachment #2: Type: text/html, Size: 1540 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG] make test is extremely slow since b3cc2f793 [9.5.1 (9.5.1-g984367 @ /home/yantar92/.emacs.d/straight/build/org/)]
  2021-12-06 14:01       ` Kaushal Modi
@ 2021-12-06 14:43         ` Ihor Radchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Ihor Radchenko @ 2021-12-06 14:43 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: emacs-org list, Nicolas Goaziou

Kaushal Modi <kaushal.modi@gmail.com> writes:

> FWIW, the tests runs in about the same time for me.
>
> Running 1 tests (2021-12-06 08:59:31-0500, selector
> ‘"^test-org-cite/adjust-note"’)
>    passed  1/1  test-org-cite/adjust-note (1.333928 sec)
>
> I just rebuild Org from main branch and I am on emacs-28 branch built last
> Friday:

Thanks for providing the extra data point. I did more research on my
system and figured that the latest problem on my side is by bad. I was
playing with data structure used to store org-element-cache and the
slowdown was a side effect of breaking change in org-persist format
(elisp reader did extremely poorly with the new datastructure).

I confirm that the slowness is resolved on clean system.

Best,
Ihor


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-06 14:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-04  5:37 [BUG] make test is extremely slow since b3cc2f793 [9.5.1 (9.5.1-g984367 @ /home/yantar92/.emacs.d/straight/build/org/)] Ihor Radchenko
2021-12-04 17:11 ` Nicolas Goaziou
2021-12-05  3:53   ` Ihor Radchenko
2021-12-05  9:10     ` Nicolas Goaziou
2021-12-06 14:01       ` Kaushal Modi
2021-12-06 14:43         ` Ihor Radchenko

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).