CodeEdit icon indicating copy to clipboard operation
CodeEdit copied to clipboard

🐞 High CPU load on lsd and pkd processes when CodeEdit is open

Open TomDev234 opened this issue 2 years ago • 17 comments

Description

High CPU load of lsd and pkd when running CodeEdit.

To Reproduce

Install published version of CodeEdit

  • Start Codedit
  • Open Activity Monitor
  • Search for "lsd" or "pkd" and see high usage

Expected Behavior

Normal CPU load

Version Information

CodeEdit: 0.0.3 macOS: 13.2.1 Xcode: 14.3

TomDev234 avatar Jul 27 '23 09:07 TomDev234

Can you elaborate a bit more? This is too little information to do something with.

Maybe screenshots from Activity Monitor or profiler data from Xcode?

matthijseikelenboom avatar Jul 27 '23 11:07 matthijseikelenboom

lsd and pkg are responsible for loading plugins. Can there be a problem with CodeEdit?

TomDev234 avatar Jul 27 '23 11:07 TomDev234

Sure, but I'm not seeing "proof" of your claim? Where do you get your claims from.

Also, you haven't set an issue title.

matthijseikelenboom avatar Jul 27 '23 15:07 matthijseikelenboom

Please be more specific. Closing this issue because it is pretty vague.

austincondiff avatar Jul 31 '23 16:07 austincondiff

@austincondiff I can confirm this issue also happens on my machine. Right when I open the app, lsd and pkd eats up around 40 - 50%, sometime even spikes to over 100%. Both of these goes away when I exit.

Screenshot 2023-08-17 at 15 04 35

Our weather is quite hot right now in the summer, and because I'm using a Macbook Air M1 (16/256), this causes my laptop to get quite hot, even when doing nothing until I close it.

biennvops avatar Aug 17 '23 08:08 biennvops

I am using Sublime Text now.

TomDev234 avatar Aug 17 '23 11:08 TomDev234

Not sure why this is closed. I noticed high pkd and led usage on my computer and was searching for an answer. I came across this, and realised I had CodeEdit installed. This is definitely still an issue and I have uninstalled the software. You should open this ticket back up.

Proof?

Open CodeEdit, have two open documents with some text in them. Now go and open activity monitor: pkd and lsd processes sit around 30% (on M1 Max). Close CodeEdit, pkd and lsd go to 0. There you go...

No idea why your software causes issues with PluginKit but it does.

tiernan avatar Aug 28 '23 16:08 tiernan

Just noticing the comments, thanks for posting. I'll open it back up.

Note that we're in active development and that this is NOT a finished product.

That said, it seems that this issue is not occurring when ran directly from Xcode. (At least "not on my machine")

(The reason this was closed is because there was not much info posted before)

matthijseikelenboom avatar Aug 28 '23 16:08 matthijseikelenboom

Before opening CodeEdit: image

With CodeEdit open: image

After closing CodeEdit: Before opening CodeEdit: image

Versions: CodeEdit: 0.0.3-alpha.36,5650b45 (current version on brew) Mac: MBA 2018 MacOS: Sonoma 14.0

Hope this is of use to you. I haven't installed Xcode and don't really know how XCode's profiler works, but if there are other ways to help, let me know.

yochem avatar Oct 09 '23 13:10 yochem

Same issue for me as well. Let me know what type of profiling you want so I can record it and send it over.

Versions: CodeEdit: 0.0.3-alpha (36) macOS: Ventura 13.6.1

lor1x avatar Oct 30 '23 14:10 lor1x

I think there are enough comments that show us that something is wrong here. We just have had our latest release to 0.0.3-alpha-37, which brings some huge changes, it could be that it is fixed. If not, we need to debug further in Xcode I think. Hopefully it will give us more insight.

@TomDev234 mentioned in this issue that "lsd and pkd are responsible for loading plugins". I do not know what kind of plugins we are talking about here, but we do not load plugins purposefully so to say. It could be that some library, that we use, does that. We'd have to look into it

matthijseikelenboom avatar Dec 28 '23 12:12 matthijseikelenboom

I can confirm it still happens on 0.0.3-alpha-37

lor1x avatar Dec 28 '23 13:12 lor1x

Can confirm as well. It's unfortunate for a really nice UI code editor like this...

biennvops avatar Jan 09 '24 11:01 biennvops

@BienGudBoy We are in pre-alpha so bugs like this are to be expected. We’ll definitely fix this one soon enough.

austincondiff avatar Jan 09 '24 14:01 austincondiff

@austincondiff The problem is with the OpenWithCodeEdit appex. I kept seeing a bunch of these in the system logs:

rejecting; Ignoring mis-configured plugin at [/Applications/CodeEdit.app/Contents/PlugIns/OpenWithCodeEdit.appex]: plug-ins must be sandboxed

It seems like pluginkit keeps trying to reinstall the plugin, so deleting it solves the problem. I suggest re-uploading alpha-37 without the plugin, just until the problem is solved. A warning would also do, because I don't think this happens on every machine.

johnothwolo avatar Jan 14 '24 21:01 johnothwolo

@johnothwolo Thanks for the info! Will test this out myself and we'll discuss this in the next meeting

matthijseikelenboom avatar Jan 15 '24 20:01 matthijseikelenboom

I found the same problem. Even I don't run CodeEdit, just installed it. lsd and pkd user process will make high CPU utilization. After I remove all files about CodeEdit(uninstall), this two process became normal. Test on my MacBook Pro M1 Pro before uninstall, CPU util: above 20% after uninstall CPU util: below 10%

jiengup avatar Jan 24 '24 09:01 jiengup