-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sleepAsync() massive slow down #3909
Comments
Some more information. I have modified asyncdispatch.nim to use DoubleLinkedList from lists.nim instead of seq for working with timers. And i got some bust to request processing.
But i think its not enough |
I don't have time to investigate the slow down currently, would be brilliant if you could look into it. |
Just for remind, not calling epochTime() for every timer is also gives us some performance.
|
Any chance you could also run these benchmarks on Linux? |
All tests performed in VM (Linux phantom 4.4.1-2-ARCH #1 SMP PREEMPT Wed Feb 3 13:12:33 UTC 2016 x86_64 GNU/Linux) Compile options: nim c asynchttpserver.nim without modifications
asynchttpserver.nim with sleepAsync(1000)
asynchttpserver.nim with sleepAsync(1000)
asynchttpserver.nim with sleepAsync(1000)
|
It looks like DoubleLinkedList & epochTime give us not so much performance in Linux like in Windows. |
Are you compiling with |
all tests was made without -d:release |
can you try it with On Sat, Feb 27, 2016 at 5:44 PM, cheatfate notifications@github.com wrote:
|
All tests performed in VM (Linux phantom 4.4.1-2-ARCH #1 SMP PREEMPT Wed Feb 3 13:12:33 UTC 2016 x86_64 GNU/Linux) Compile options: nim c -d:release asynchttpserver.nim without modifications
asynchttpserver.nim with sleepAsync(1000)
asynchttpserver.nim with sleepAsync(1000)
asynchttpserver.nim with sleepAsync(1000)
|
Ok, i have some results. Benchmark results in VM (Linux phantom 4.4.1-2-ARCH #1 SMP PREEMPT Wed Feb 3 13:12:33 UTC 2016 x86_64 GNU/Linux) Compile options: nim c
Compile options: nim c -d:release
|
Introduce `callSoon` to dispatch callbacks in context of pool() procedure, to avoid recursion problems
This is now fixed I think. |
This is not fixed actually. |
I'm trying to modify asynchttpserver.nim to make it more secure and reliable (add timeouts and limits).
But i found a real problem, using sleepAsync() as timeout timer, i've got a massive slow down in requests processing.
This benchmarks made on asynchttpserver.nim without any modifications:
As you can see we have very stable response time of 0.003s.
Now i add sleepAsync(1000) to asynchttpserver.nim line 178
Before:
await client.recvLineInto(lineFut) # TODO: Timeouts.
After:
await client.recvLineInto(lineFut) or sleepAsync(1000) # TODO: Timeouts.
Benchmark results for modified asynchttpserver.nim:
As you can see its more then 2x times slower, then version without sleepAsync().
It also consumes much more memory... about 60Mb with sleepAsync() and only about 8mb without sleepAsync().
P.S. Benchmark tests was performed on Windows 7 x64 with openload application. Compiled using x86_64-w64-mingw32 (gcc (GCC) 4.8.3).
The text was updated successfully, but these errors were encountered: