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

[Feature] Undo Rating Function #35

Closed
l3kn opened this issue Jun 27, 2020 · 3 comments
Closed

[Feature] Undo Rating Function #35

l3kn opened this issue Jun 27, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@l3kn
Copy link
Owner

l3kn commented Jun 27, 2020

It would be nice to re-rate a card that has been rated incorrectly,
possibly also unsuspending it if the last action was to suspend a card.

After each rating, the previous review data of the position can be stored in the session
so it can be reverted later.

I think the hardest part about this is chaning the entry in the review history file,
as it can grow pretty large (18mb, 143k lines in my case) so loading it to change the last line takes some time.

@l3kn l3kn added the enhancement New feature or request label Jun 27, 2020
@natask
Copy link
Contributor

natask commented Jun 27, 2020

I think the hardest part about this is changing the entry in the review history file,
as it can grow pretty large (18mb, 143k lines in my case) so loading it to change the last line takes some time.

We can delay updating the review history file by one or more entries. Place them in a separate buffer/file and update one entry at a time to review history when an action is completed by a user and the buffer is full to its maximum assigned size (one or more entries). we can then save the whole buffer to the review history file on org-fc-pause or quit.

Interesting side point is the scalability of org-fc. are there things we can do to make it more scalable?

@l3kn
Copy link
Owner Author

l3kn commented Jun 27, 2020

Storing review history entries in memory is a good idea!
They can be written to the main file once a review ends or emacs is closed.

Regarding scalability:
I have ~30k flashcards in ~2300 .org files,
17k of those were imported automatically and are not active yet (suspended)

  • Generating the review history stats for the dashboard takes 460ms
  • Generating an index of all cards takes 4.8s (needed for each review session)

Both these times are higher than I'd like.

Review history statistics can be speed up by limiting them to the last n (e.g. 10k) entries.
They could also be stored in memory, which would be useful for generating per-context review statistics
(currenly even if a review context is selected, the dashboard shows statistics for all reviews).

The card index can also be stored in memory, updating only entries for files that have changed since the last review.
I've built a prototype implementation of this cache and it cuts down the time to a few ms.

@l3kn
Copy link
Owner Author

l3kn commented Aug 8, 2020

Closing, moved to https://todo.sr.ht/~l3kn/org-fc/5

@l3kn l3kn closed this as completed Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants