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

practiceService should pre-fetch more questions #12

Open
slaweet opened this issue Feb 23, 2016 · 3 comments
Open

practiceService should pre-fetch more questions #12

slaweet opened this issue Feb 23, 2016 · 3 comments

Comments

@slaweet
Copy link
Member

slaweet commented Feb 23, 2016

practiceService.getFlashcard [0] has currently some questions in the queue (On both geography and anatomy is fc_queue_size_max [1] set to 2). New questions are fetched only when the queue is empty and user has to wait for questions being fetched from the server (when there is high traffic it happens a lot).

practiceService should be changed so that it has always some questions in the queue, but at the same time it can replace them with more fresh (recently fetched) questions.

[0] https://github.com/adaptive-learning/proso-apps-js/blob/master/src/flashcards-practice/practice.js#L127
[1] https://github.com/adaptive-learning/proso-apps-js/blob/master/src/flashcards-practice/practice.js#L25

@thran
Copy link
Contributor

thran commented Feb 23, 2016

It seems that fc_queue_size_max is set to 1 [0] (and it is also corresponding to reality).
I understand the problem with high traffic, maybe we should try fc_queue_size_max=2.
I also understand motivation of replacing question in queue but I believe that solution of problems during high traffic do not lies in this (we give backend more work to do - selection flashcards is expensive and replacing them is wasting).
Solution can be in settting fc_queue_size_max dynamically based on traffic?

[0] https://github.com/adaptive-learning/geography/blob/master/geography/proso_config.yaml#L17

@slaweet
Copy link
Member Author

slaweet commented Feb 23, 2016

It is not just high traffic problem, but also low network speed on mobile.

I think that fetching questions after every answer is expensive, but selecting 4 flashcards instead of 2 isn't that much of additional cost (at least it was the case in the original implementation. I'm not sure how it's currently implemented).

@papousek
Copy link
Member

You are right, overhead for 4 flashcards instead of 2 is really small (I think).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants