-
kramo
Hi, the config/data directory situation on macOS seems kind of fucked. Both directories are hardcoded instead of using what the dirs crate gives you. For data I’m really not sure why, for config, it’s probably to respect XDG on Mac for config, but it just hardcodes .config instead of reading from the variable anyway. At least for data, it should probably just use the crate, and for config, it should also respect the environment variable. Or alternatively, maybe just drop the crate and do this fully custom? https://codeberg.org/GramEditor/gram/src/branch/main/crates/paths/src/paths.rs
-
krig
Not sure why they did it the way they did.. They do store the local sqlite DB in Library/Application Support, but not the user config. Then again it would be really annoying to keep the user config there, wouldn't it? Not sure. I don't really mind the way it is set up now.
-
kramo
But even then, not using the variable and hardcoding .config instead is just wrong. Plus, I still don't know why they hardcode Application Support when the create just gives it to you.
-
kramo
I ran into this when I was messing with XDG_CONFIG_HOME and realized that Gram was not respecting it
-
kramo
markdown TwT
-
kramo
and *crate instead of create
-
yilmazer
Hello, thank you Krig and everybody for the latest version. The binary size has significant reduction for macos :) I want to backport lsp path and memory display PRs from Zed. It is around 230 lines. Is it ok for you?
-
krig
Hmm sounds OK to me yeah
-
Savoita
> kramo: > Hi, the config/data directory situation on macOS seems kind of fucked. Both dire… Perhaps they did not expect Mac OS to use XDG vars? ↺
-
Savoita
Or, I guess the use LLM generated code liberally, so... the LLM didn't expect Mac OS to use XDG vars?✎ -
Savoita
Why have they separated the project into so many disparate crates? Is the compile time really bad enough to justify it?
-
Savoita
https://codeberg.org/GramEditor/gram/src/branch/main/crates/paths/src/paths.rs The static vars here should almost certainly just be `LazyLock`s, as that's exactly how they are used.
-
Savoita
I may PR that.
-
Savoita
Or, I guess they use LLM generated code liberally, so... the LLM didn't expect Mac OS to use XDG vars? ✏
-
krig
@Savoita that'd be great! And yeah reimplementing things that are already available is typical LLM stuff...
-
krig
@Savoita guessing they use OnceLock because they create the directory if it doesn't exist
-
yilmazer
Thank you Krig. Also, I have been investigating a memory issue for the last few days. The initial memory footprint of Gram is lower than Zed, as expected. However, when a lsp is activated and I hover over a text, Gram's memory jumps by 100 MB, while Zed's stays the same. I searched and applied many performance and memory tweaks from Zed but the result is the same. I think, it is related to memory allocation system of Gram. Therefore, there is possibly no bug here. Do you have any advice about this?
-
krig
@yilmazer Interesting, this is something I haven't looked closely at. I don't really understand why memory usage would jump when hovering, seems strange.. But there is a lot of allocation per-frame in Gram so it's also not entirely surprising. Maybe they have changed how hover text is managed. One thing I know is that they have rewritten the markdown handling while I haven't had time yet so that stuff is possibly part of it. Maybe there is a new markdown parser allocated for every hover or something like that.
-
koru
Can we debug/profile Gram itself and know which part cause this memory usage?
-
yilmazer
I checked rpc messages and made many experiments but memory behaviour didn't change. In the meantime, I am collecting performance related small commits in Zed which are not in Gram. I keep investigating.
-
krig
@koru @yilmazer there's no builtin memory view and it's a bit tricky in async rust.. I haven't really tried to debug or profile memory usage at all yet, just binary size so far..
-
krig
there is this but it's linux only: https://github.com/koute/bytehound
-
yilmazer
I experienced this issue on mac. I don't know if it exists on other platforms. I tried mimalloc and jemalloc, memory jump still happens.
-
Savoita
It it normal for rust analyzer to get stuck at a seemingly random crate when indexing? I can't get it to finish
-
koru
Based.
-
krig
@Savoita no, that’s not normal. Could be a memory issue perhaps?
-
mort
Today at 17:21: > Why have they separated the project into so many disparate crates? Is the compile time really bad enough to justify it? Gram itself (as in the collection of crates in the gram repo) takes quite a while to compile. My understanding is that in Rust, every crate is compiled in a single thread, the only concurrency in the build process is that it compiles multiple crates at a time. So Gram would probably be really slow to compile if it was all one crate yeah. That doesn't necessarily mean that the current split is optimal of course
-
mort
When I quote like that, does XMPP send info about who was quoted? Does the quoted person get a ping? On my client it looks a lot like I just sent a message with literally a message copy/pasted in but that would be weird wouldn't it?
-
mort
I quoted @Savoita, in case that's necessary for a ping
-
krig
I also don't see any link to the quoted author from here, guessing it doesn't ping then
-
olive
some clients support replies, which in other clients will appear as quotes. this just appears as a quote me (but my client supports replies)✎ -
olive
some clients support replies, which in other clients will appear as quotes. this just appears as a quote in my client (but it supports replies) ✏
-
olive
meaning your client didn't send out a reply (or malformed it)
-
olive
how pings work is largely up to the client I think? the one I use (dino) pings like irc, when your nick is mentioned. I've not actually paid attention to whether this includes replies or not