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

Track thread page for each post to optimise deletion #98

Open
rossjrw opened this issue Apr 27, 2024 · 0 comments
Open

Track thread page for each post to optimise deletion #98

rossjrw opened this issue Apr 27, 2024 · 0 comments
Labels
help wanted Extra attention is needed optimisation Make an existing feature faster or smaller

Comments

@rossjrw
Copy link
Member

rossjrw commented Apr 27, 2024

Deletion currently runs on an entirely per-post basis and isn't aware of anything else. If it scans a remote thread page and observes that a post seen there other than its target post is in it check queue, it can optimise by marking that post as not deleted which prevents it from checking that thread page another time. But that only happens coincidentally, and it can't select posts to check from the database to optimise how often that case happens.

By tracking thread page for each post, the posts that are selected to check for deletion can be optimised to minimise the number of unique pages that will be checked. This will enable the above optimisation to have as much impact as possible; additionally, it will be able to guarantee that a post not seen in that thread page was actually deleted (which the optimisation doesn't account for, needing to check for that post individually every time).

However, thread page isn't immutable. If a post earlier in the thread is deleted, posts after it in the thread move up a slot; there are 12 slots per page so necessarily 1/12 of the remaining top-level posts will change page number. After #85 we do not track posts that are not notifiable so this deletion will most likely be missed on our end. The consequence of that will be that every time an untracked post is deleted, 1/12 of the tracked top-level posts in that thread would be erroneously marked as deleted on our end.

What's the solution for that?

@rossjrw rossjrw added optimisation Make an existing feature faster or smaller help wanted Extra attention is needed labels Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed optimisation Make an existing feature faster or smaller
Projects
None yet
Development

No branches or pull requests

1 participant