sleep 16ms when using synchronous io on windows for reducing cpu usage#175
sleep 16ms when using synchronous io on windows for reducing cpu usage#175bung87 wants to merge 1 commit intoPMunch:masterfrom
Conversation
|
Why would we need to sleep with synchronous IO? It should just block on the read of stdin. And why 16ms? |
|
it's 1000ms / 60fps, the infinite loop cause cpu high, but it doesn't has to be. as the server is for text editor not game nor real time application, I think it's fine. |
|
Ah right, I guess 16ms makes sense. But it still doesn't make sense that it busy loops in an infinite loop. Since its using synchronous IO it should be blocking on trying to read input from standard input. If you're seeing high CPU usage with nimlsp it's much more likely a nimsuggest issue. |
|
yeah, the result is it get lower cpu usage on some projects, some still very high. |
|
Again, it doesn't make any sense that sleeping before a synchronous read should affect CPU performance short of just limiting the amount of actual work it's able to do. |
No description provided.