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

Thinking about performance #124

Open
6 tasks
shish opened this issue Sep 14, 2022 · 1 comment
Open
6 tasks

Thinking about performance #124

shish opened this issue Sep 14, 2022 · 1 comment
Labels
thought Things which may or may not be a good idea

Comments

@shish
Copy link
Collaborator

shish commented Sep 14, 2022

It'd be nice if our automated tests could spot something taking an unreasonable amount of time (ie, we should try to catch code which runs fine in dev with 10 tracks but takes O(n^2) time with 10,000 tracks in prod)

I think most of the code is O(1) - the things which can grow are:

  • tracks.json - grows slowly over time, currently ~2400 entries, 4.5MB (1MB compressed), how big should we aim for?
  • queue.json - most events run for a few hours, but a booth room might have a single queue for the whole weekend. How big would the queue be if it was left running and actively-used 24 hours a day for 7 days? Would it be difficult to support a queue that large?
  • settings.json - most settings are O(1), but the allowlist of member badge names is O(size of con) - how big of an event do we want to support? I think 500 (Minamicon-sized) is a minimum, which is probably 5KB of data. 10,000 members seems like a ridiculously huge number, but it's only ~100KB of data, so maybe we should aim to support that?
  • is there anything else that grows?

If we generate some synthetic data sets which push the limits of our scale, what would we want to test with them?

  • api_queue
    • which endpoints?
  • browser2
    • search
  • player2
    • Is there anything here? Player2 only ever deals with the next ~20 tracks no matter how long the queue is, the only O(n) algorithm in the codebase is current_and_future(queue_items)

Maybe also worth aiming for some specific number even for the O(1) parts, like "no request should take longer than 50ms"?

@shish shish added the thought Things which may or may not be a good idea label Sep 14, 2022
@shish
Copy link
Collaborator Author

shish commented Nov 7, 2022

At hotarucon 2022 we used one queue for the whole weekend, 12 hours of playtime in total - it got up to 307 tracks, 55KB of queue.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
thought Things which may or may not be a good idea
Projects
None yet
Development

No branches or pull requests

1 participant