Fork me on GitHub
#cider
<
2024-07-29
>
oλv19:07:45

I’ve been having performance issues in clojure-mode due to font locking. M-x font-lock-mode removed the lag, but I like my colors. Is switching to clojure-ts-mode likely to be a solution to my problem?

vemv19:07:36

clojure-ts-mode is not 100% stable as of today so I'd say it comes with its own set of tradeoffs Classic clojure-mode works well for many people. Is a given file particularly large or nested? Maybe you have many .clj buffers simulatenously open?

oλv19:07:49

Yes the file is 2386 loc and it will keep growing, I’d prefer not splitting it

oλv19:07:38

I’m fine with not 100% stable if it improves the performance

vemv19:07:41

Yeah I'd say that's quite exceptionally large. I have some 1.3kloc file and I feel ashamed of it :) (and perceive lag)

🙃 1
vemv19:07:29

But going ahead with clojure-ts-mode is fine 👍

👍 1
vemv19:07:53

Correction, it's 2.2k loc now 😇 I was thinking of splitting it for unrelated reasons - a bit harder than usual for me as I'm currently working with a unusual paradigm.

oλv19:07:31

For a solo project I find working in a single file to be a significant productive boost. It keeps me from getting distracted with modularisation and boundaries and so forth. When it gets messy I just group it into do/comment sections and M-x hs-hide-all. It works for me 😅

👍 1
1
onetom17:07:14

what do you do if u look at the 8k LoC [clojure.core](https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj) ? just turn off clojure-mode or font lock?

oλv17:07:11

Hmm I tried editing core.clj and it was first at fast. Then when I opened it in more buffers it got slow.

vemv17:07:56

Normally nothing happens that I remember, as one isn't editing that file. At least on my setup it's not font-lock itself that is slow but things like format-on-save or indentation calculation. (jumping to that specific file is also a relatively frequent thing to do, so people would have complained)

oλv17:07:41

when working in anymentions.clj i tend to have like a second delay when inserting text

oλv17:07:01

but maybe it’s not font locking :thinking_face:

oλv17:07:11

is there a good way to do profiling in emacs?

vemv17:07:34

electric-indent-mode is a usual suspect > is there a good way to do profiling in emacs? Yes (gotta leave, sorry)