godot-wakatime icon indicating copy to clipboard operation
godot-wakatime copied to clipboard

Plugin is significantly slowing down Godot 4 editor

Open HauntedBees opened this issue 2 years ago • 8 comments

I've been using this plugin since the 3.x days but recently I've noticed that Godot 4.1 had been running extremely slowly. I upgraded to 4.1.2 to see if that was the issue and it was still running slowly. After trying several other things, I started disabling plugins one by one, and after disabling godot-wakatime, everything is working as expected -- no delays when switching between scripts in the script editor, no freezing when trying to rotate a 3D scene. This is a recent issue; I'd been using v1.5.0 of the plugin for a few months now and only within the past few weeks has this slowness been noticeable.

Plugin Version: 1.5.0 Godot Version: v4.1.2.stable.official [399c9dc39] Platform: Linux Mint 21.1 Cinnamon 5.6.8 Kernel Version 5.15.0-86-generic Processor: Intel© Core™ i5-6600K CPU @ 3.50GHz × 4 Memory: 32GB

HauntedBees avatar Oct 06 '23 01:10 HauntedBees

@gandarez could it be one of the major changes recently? Upgrading chroma to V2 or guessing language from file contents

alanhamlett avatar Oct 06 '23 04:10 alanhamlett

@gandarez let's release a wakatime-cli update that adds ~/.wakatime.cfg config: disable_language_content_detection = true To return heartbeat.LanguageUnknown before reading file contents.

That way @HauntedBees can enable the config and see if the performance issue is fixed.

alanhamlett avatar Oct 06 '23 04:10 alanhamlett

Or it could be caused by 312ae92b4a40bd75ba117d9a8e826e7d371314d6. @HauntedBees can you try downgrading the plugin to the v1.4.0 and see if it's fixed?

alanhamlett avatar Oct 06 '23 04:10 alanhamlett

Also, is it always slow or only sometimes slow?

alanhamlett avatar Oct 06 '23 12:10 alanhamlett

The only thing I can see is Godot doesn't run the wakatime-cli in the background and freezes the main process?

gandarez avatar Oct 06 '23 15:10 gandarez

Looking deeper to the code it's using an older version of wakatime-cli v1.54.0. It should always use the latest version as much as possible.

https://github.com/thomazthz/godot-wakatime/blob/master/addons/wakatime/wakatime.gd#L9C7-L9C23

gandarez avatar Oct 06 '23 16:10 gandarez

Hi @gandarez - I updated the code to use the latest version of wakatime-cli - v1.85.1 - then re-enabled the plugin. It installed the right version, and immediately began running slowly again. When the plugin is active, switching between different scripts in the Script Editor goes from being immediate to taking over 2 seconds, and saving a file goes from taking under half a second to taking around 3 seconds.

I cannot downgrade to version 1.4.0 of godot-wakatime as 1.5.0 is the first version to support Godot 4.

HauntedBees avatar Oct 07 '23 04:10 HauntedBees

@thomazthz does wakatime-cli run in foreground and blocks the UI?

gandarez avatar Oct 07 '23 11:10 gandarez