Decrease polling frequency to 20 Hz in the GDScript language server

This decreases the language server's CPU usage.
This commit is contained in:
Hugo Locurcio 2019-10-10 16:41:36 +02:00
parent 0148112730
commit 7f49c5dd42
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
1 changed files with 2 additions and 1 deletions

View File

@ -56,8 +56,9 @@ void GDScriptLanguageServer::_notification(int p_what) {
void GDScriptLanguageServer::thread_main(void *p_userdata) { void GDScriptLanguageServer::thread_main(void *p_userdata) {
GDScriptLanguageServer *self = static_cast<GDScriptLanguageServer *>(p_userdata); GDScriptLanguageServer *self = static_cast<GDScriptLanguageServer *>(p_userdata);
while (!self->thread_exit) { while (!self->thread_exit) {
// Poll 20 times per second
self->protocol.poll(); self->protocol.poll();
OS::get_singleton()->delay_usec(10); OS::get_singleton()->delay_usec(50000);
} }
} }