-
Notifications
You must be signed in to change notification settings - Fork 32
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
Adding songs to the queue is slow #57
Comments
I've fixed this in my fork by implementing I'll try to find time to create a pull request for |
Hmm, would you mind getting me a profile of that method call? http://tmm1.net/ruby21-profiling/ Would be good to see where we're spending most of the execution time. |
Stackprof did not work for me: tmm1/stackprof#63 So, instead I manually profiled the t1 = Time.now
# code from the method
last_statement.tap{ $prof[:methodname] << (Time.now-t1) } and creating a global The summary is:
In other words, ~all (99.8%) of the time is spent waiting on |
Using a different profiling mode with stackprof I got results from it. Not sure how much to trust them, though, since the results are so different for intervals of 1000µs (1ms), 500µs, 100µs, 50µs, and 5µs:
|
Following up from discussion over on the stackprof issue: the "97% miss rate" indicates that the profiler is not able to see most of the code, because it's being blocked by The only thing it did point out was that |
I think this is most likely caused on the server side then, since we're waiting for a response to each command. I think what MPC does is completely ignore the response from the server |
You could also try using a UNIX socket, I think those should be faster than TCP for local connections |
On my live music server:
This may seem trivial, but when dynamically generating the queue with 100 songs this is the difference between waiting 4 seconds versus half a second.
I wonder if this is the
@mutex.synchronize
slowing me down; I'll be looking at ways to speed up the batch adding of many songs.The text was updated successfully, but these errors were encountered: