This repository was archived by the owner on Jun 1, 2024. It is now read-only.
[Do not merge] Fetch comments concurrently in a thread pool#2502
Open
AdamNiederer wants to merge 1 commit intoHaptic-Apps:masterfrom
Open
[Do not merge] Fetch comments concurrently in a thread pool#2502AdamNiederer wants to merge 1 commit intoHaptic-Apps:masterfrom
AdamNiederer wants to merge 1 commit intoHaptic-Apps:masterfrom
Conversation
While it isn't the immense performance increase I anticipated, it does help speed up offline caching somewhat.
Collaborator
|
Thank you for the PR! Actually, this is done on purpose because Reddit has API rate limitations, and the caching mechanism was designed to not break these limits. Unfortunately don't know if your changes break these limits, but I know that JRAW has a master rate limit built into it (I figured serially downloading would ensure we don't break any limits on our side either). One way we could do this is to execute each as a separate pooled thread, but keeping track of all of those threads is pretty messy and that's why I opted to just have one master async thread. If you have any other suggestions on how to go about this, I'm open to any suggestions! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there,
I've been trying to improve the speed of offline subbreddit caching, and I figured that serially awaiting each HTTP request was eating the bulk of the time.
While fixing that problem, I found that
RedditClient.execute()has some kind of lock which doesn't let me query Reddit concurrently. Although this patch doesn't hurt the wall time of the caching process, I'd recommend not merging this until I can figure out how to get around that limitation. Does reddit have a particularly oppressive rate limiter or something?