Skip to content
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

Investigate performance issues #83

Open
spezifisch opened this issue Oct 28, 2024 · 2 comments
Open

Investigate performance issues #83

spezifisch opened this issue Oct 28, 2024 · 2 comments
Assignees
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@spezifisch
Copy link
Owner

This is more of a "note to self":

Re: #77 (comment)

Why is it so laggy on my setup?

@spezifisch spezifisch added bug Something isn't working question Further information is requested labels Oct 28, 2024
@spezifisch spezifisch added this to the v1.0.0 milestone Oct 28, 2024
@spezifisch spezifisch self-assigned this Oct 28, 2024
@rkowalsk
Copy link

rkowalsk commented Nov 5, 2024

Browsing the songs in the queue is very laggy for me, is it what you're talking about ?

@xxxserxxx
Copy link
Collaborator

@spezifisch is it only stmps, or do you notice lagging with other clients? Have you tried it with, e.g. Tempo on your phone, or with another client?

I did provide a caching PR that should address the aggravation caused by the addition of album art; did you notice whether it helped?

The recent synced lyrics PR won't help any -- the data's far smaller, but no attempt to fork it out into a future value was made in that patch, and it's still more API calls made.

GetPlaylists is always slow, which is why I implemented it the way I did, with plenty of decoupling.

Have you played with making API calls with bog standard curl? I do this a lot for debugging, and combined with a tool like hyperfine, you can learn a lot about isolating your server performance. For example:

Given a call you know works:

curl "http://me:[email protected]:4533/rest/search3?u=me&c=stmps&p=supersecret&f=json&v=1.8.0&query=Doja%20Cat" |\
     jq . | \
    less

you can turn it into a benchmark with:

hyperfine 'curl "http://me:[email protected]:4533/rest/search3?u=me&c=stmps&p=supersecret&f=json&v=1.8.0&query=Doja%20Cat"'

For example (and reference), my gonic server's DB statistics are:

  • folders: 2705
  • albums: 1830
  • artists: 2479
  • album artists: 1071
  • tracks: 17207

Searching for "Doja Cat" (lexically near the beginning) vs "ZZ Top" (near the end) gives me the following results:

Benchmark 1: curl http://.../rest/search3\?...\&query\=Doja%20Cat
  Time (mean ± σ):      43.6 ms ±   2.7 ms    [User: 3.0 ms, System: 5.1 ms]
  Range (min … max):    37.8 ms …  49.8 ms    64 runs

Benchmark 1: curl http://.../rest/search3\?...\&query\=ZZ%20Top
  Time (mean ± σ):      43.0 ms ±   2.7 ms    [User: 2.4 ms, System: 3.9 ms]
  Range (min … max):    37.2 ms …  51.7 ms    73 runs

so about the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants