From 7f49c5dd4212c9f9673d1b7007d0d4805b38ce40 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 10 Oct 2019 16:41:36 +0200 Subject: [PATCH] Decrease polling frequency to 20 Hz in the GDScript language server This decreases the language server's CPU usage. --- modules/gdscript/language_server/gdscript_language_server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/language_server/gdscript_language_server.cpp b/modules/gdscript/language_server/gdscript_language_server.cpp index 62c212a2bda..8d58b99e02b 100644 --- a/modules/gdscript/language_server/gdscript_language_server.cpp +++ b/modules/gdscript/language_server/gdscript_language_server.cpp @@ -56,8 +56,9 @@ void GDScriptLanguageServer::_notification(int p_what) { void GDScriptLanguageServer::thread_main(void *p_userdata) { GDScriptLanguageServer *self = static_cast(p_userdata); while (!self->thread_exit) { + // Poll 20 times per second self->protocol.poll(); - OS::get_singleton()->delay_usec(10); + OS::get_singleton()->delay_usec(50000); } }