journalctl-mode icon indicating copy to clipboard operation
journalctl-mode copied to clipboard

Slow "journalctl | wc -l"

Open lassemaatta opened this issue 1 year ago • 2 comments

Hi, I was trying out this neat package and noticed that M-x journalctl froze my emacs until I aborted with C-g. After a bit of investigating I noticed that during M-x journalctl it spawned a journalctl | wc -l command that was using up one cpu core and blocking emacs. I guess (journalctl--run '("")) ends up invoking that and takes forever to finish. I managed to work around this by vacuuming my logs from about 1 GB to 100 MB, but even then it takes a moment to count all the lines. Perhaps this behaviour could be fine tuned a bit so that it doesn't try to consume the whole log contents and instead defaults to something like journalctl --boot?

lassemaatta avatar Nov 11 '23 12:11 lassemaatta

That is a known issue. I have an idea, how to solve it, but it will take a moment to address. I am working on asynchronous process support, which should make journalctl-mode faster and less resource intensive in general. For the moment I can only ask you to be patient.

SebastianMeisel avatar Nov 11 '23 19:11 SebastianMeisel

Would it be more performance efficient to call libsystemd - sd-journal?

Thaodan avatar Nov 12 '23 19:11 Thaodan