cider

2025-04-23T16:48:25.158029Z

Is it normal behavior for Cider nREPL middleware to send metadata for all private vars in a NS when it's required? I don't think this would be an issue normally, but over in #rama we're seeing issues when loading com.rpl.rama which includes a ton of private vars and causes Conjure to hang for a several minutes. (I'm assuming Cider itself handles this metadata info from nREPL more asynchronously?) Not sure why private vars would be included since they wouldn't make sense for completions. I'm not very familiar with the nREPL protocol; I'll attach the full trace of messages if it's helpful.

2025-04-23T16:48:39.041449Z

Full logs

2025-04-23T16:49:43.074299Z

I realize this may be a #conjure issue, though the presence of private vars leads me to think it may be Cider middleware change or configuration to only send public vars.

2025-04-23T17:04:13.528109Z

Looks like over 600 vars being returned Cider nREPL middleware itself takes over a minute before it finishes sending all the metadata. (And then Conjure is inefficient about processing them and takes another couple minutes to process them.)

2025-04-23T18:51:21.247499Z

Hmm, seems to not be an issue with Calva's middleware usage, all I see there is a single changed-namespaces event. Could be the weird way I was trying to log the messages in Conjure's Lua code while decoding the bencode, but it seems to return in 4 seconds instead of the 77 seconds I was seeing.

oyakushev 2025-04-23T20:02:39.180219Z

It indeed looks like Conjure takes the result of track-state middleware (https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/track_state.clj) which is a single message, like you observed in Calva, and for whatever reason splits and logs it into multiple "messages". The 600 vars is not usually a problem if the processing done on that data is quick. So, I'd take this to #conjure as there's definitely a problem there with all this logging. It would also be ideal to update cider-nrepl dependency there as a lot of improvements have happened in the latest version, including the improvements to track-state (less data is transferred and retained).

2025-04-23T20:03:58.899519Z

👌 Much appreciated 🙂