Cider: Cider powerline performance issue

Created on 9 May 2018  Â·  11Comments  Â·  Source: clojure-emacs/cider

Expected behavior

No performace issues

Actual behavior

The last version of cider shows significant performance issues while navigating/editing clj/cljs files.
Emacs profile shows severe usage of cider--modeline-info
(profile attached as txt file below)
https://github.com/clojure-emacs/cider/files/1987891/emacs-cider-profile.txt

Steps to reproduce the problem

  • Start emacs
  • Jack in cider
  • Mention performance issues while navigating/editing file
  • Start emacs profiler
  • Edit/navigate file
  • Check profiler results

Environment & Version information

CIDER version information

;; CIDER 0.17.0 (package: 20180507.1227) (Andalucía), nREPL 0.2.13
;; Clojure 1.8.0, Java 1.8.0_20

Lein/Boot version

Leiningen 2.8.1 on Java 1.8.0_20 Java HotSpot(TMe) 64-Bit Server VM

Emacs version

GNU Emacs 25.3.1
0.200.[email protected] (spacemacs)

Operating system

MacOS 10.13.4

Profiler info

emacs-cider-profile.txt

bug

Most helpful comment

Hmm, oddly enough I don't see any recent changes here. You can solve this temporary with:

(setq cider-mode-line " cider")

Until we figure out what exactly is the problem you've experienced.

All 11 comments

And this was fast on 0.16?

@bbatsov I did not spot any issues at glance.
Could that be disabled? I don't use anything from powerline besides line number and file name.

Just to clarify - I use Spacemacs and update packages from time to time. I'm not sure if I ever used 0.16 or not. But with the latest update performance has degraded dramatically - I can barely work with clj* files when cider is connected.

Hmm, oddly enough I don't see any recent changes here. You can solve this temporary with:

(setq cider-mode-line " cider")

Until we figure out what exactly is the problem you've experienced.

@bbatsov thank you! That helped a lot.

I've looked at the profiling data and I assumed it seems that clojure-project-dir is the slow function in your case. Are you working over tramp by any chance?

In general it's clear this is something we need to cache, though.

@bbatsov
No, I'm not using tramp or anything remote.
Just FYI I did cloc in the project root.
Maybe I need to exclude node_modules from ... somewhere?

→ cloc .
   49131 text files.
   30910 unique files.
   21237 files ignored.

github.com/AlDanial/cloc v 1.76  T=123.92 s (226.6 files/s, 41541.3 lines/s)
---------------------------------------------------------------------------------------
Language                             files          blank        comment           code
---------------------------------------------------------------------------------------
JavaScript                           16785         354711         470346        2054662
JSON                                  3044            373              0         641343
Markdown                              2061          84730             10         225607
C                                      733          28934          42139         179912
C/C++ Header                           604          17935          36393          81777
TypeScript                             652           5353         119458          76659
HTML                                   548          37051           2314          75583
C++                                    232          12036          13945          65281
Perl                                    55           7093           5810          57885
CSS                                    762           9097          30147          52790
ClojureScript                          274           9986           2078          50433
Python                                  88           6230          10611          25368
Go                                      42           3466           2979          24597
Protocol Buffers                       377          10518          32202          22953
Clojure                                142           3420            258          18356
XML                                    312           3263           1325          16168
Sass                                   143           3382           1099          15265
ClojureC                                48           2837            538          14146
Assembly                                20           1586           2752           9843
CoffeeScript                            81           1881            479           8724
SQL                                    361           1695            726           7347
MSBuild script                          15              1              0           5807
CMake                                   71            763            790           3576
YAML                                   251            265            280           3464
D                                       70              1              0           3429
make                                    94            884            662           2959
Bourne Shell                            47            609            662           2857
Ada                                     10            599            560           1681
Pascal                                   5            219            551           1200
C#                                      10            285            513           1085
Windows Module Definition               11            177             17           1030
Ruby                                    18            187             24            926
Cucumber                                35            155             46            768
m4                                       6             97             62            683
LESS                                     9            113             80            567
DTD                                      1            179            177            514
ERB                                     14             29              0            328
Bourne Again Shell                      13             73             37            285
Lisp                                     3             42             38            264
IDL                                      6             38              0            167
Windows Resource File                    5              9              4            163
diff                                     2             29            147            115
Handlebars                               3             13              0             65
PHP                                      1              8              0             47
SAS                                      1             14             22             32
OCaml                                    1             23            104             29
NAnt script                              1              7              0             26
DOS Batch                                6              3              0             25
JSX                                      2              4              2             22
Pug                                      1              0              0             10
zsh                                      1              4             14              7
---------------------------------------------------------------------------------------
SUM:                                 28077         610407         780401        3756830
---------------------------------------------------------------------------------------

Hmmm, node_modules are excluded in .projectile

→ cat .projectile
-/public
-/target
-/node_modules
-/log
-/*.log
-/resources/public
-/.git

This doesn't really help clojure-mode. OK, now I know what's happening - because your project's pretty big finding its root is taking a while. Anyways, with some simple caching we will certain fix this.

I've added a small patch to clojure-mode, so now results from clojure-project-dir are cached. That should solve the reported problem.

I guess we can close this one.

Was this page helpful?
0 / 5 - 0 ratings