Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Perform JSON-encoding of CS API responses in a background thread #7926

Closed
wants to merge 3 commits into from

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jul 21, 2020

This is an implementation of the solution proposed in #6998 (comment); viz. moving JSON-encoding out to a background thread.

@richvdh
Copy link
Member Author

richvdh commented Jul 21, 2020

I'm not entirely sure I'm happy with this.

I worry that it might be making things substantially worse for the common case: if you've got something trivial to encode, then pushing it out to a separate thread is likely to be more work than just doing the encoding inline.

I also worry that sharing the default threadpool with whatever else might be going on there (media thumbnailing, password hashing) could mean that we end up blocking C-S responses behind other CPU-intensive work.

Still, I wrote it to get my HS going after riot-android decided to DoS it with initialsyncs, so I thought it was worth opening a PR.

@richvdh
Copy link
Member Author

richvdh commented Jul 21, 2020

Per #6998 (comment): I think there are better ways to solve this.

@richvdh richvdh closed this Jul 21, 2020
@richvdh richvdh deleted the rav/json_in_thread branch December 1, 2020 12:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant