summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2019-10-10 16:41:36 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2019-10-10 16:42:05 +0200
commit7f49c5dd4212c9f9673d1b7007d0d4805b38ce40 (patch)
treec93db56282d3ecca1abf724825e0abb7e60060db /modules/gdscript
parent01481127301b7defadb69cd712f82ad7f840340e (diff)
Decrease polling frequency to 20 Hz in the GDScript language server
This decreases the language server's CPU usage.
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/language_server/gdscript_language_server.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gdscript/language_server/gdscript_language_server.cpp b/modules/gdscript/language_server/gdscript_language_server.cpp
index 62c212a2bd..8d58b99e02 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<GDScriptLanguageServer *>(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);
}
}