golang / oscar

[mirror] Open source contributor agent architecture repo.
BSD 3-Clause "New" or "Revised" License
150 stars 19 forks source link

internal/goreviews: scale dashboard loading #44

Open zpavlinovic opened 1 month ago

zpavlinovic commented 1 month ago

It currently takes a significant chunk of time to load the attention dashboard. With every request, we would redo all of the work: load all changes, score them, and present them. Instead, we should do it incrementally.

One way to do this is as follows. We have a separate watcher that tracks updates to changes. We also have a db where we keep metadata on non-rejected changes with their scores. For each new change update, we see if the change should be rejected. If so, we just remove it from the db. If it is a non-rejected change, we re-score it. We then present only non-rejected changes only.

Updating the db and rendering the dashboard can be done within a single handler, or we can keep them separate. This algorithm will take some time the first time we run it, but afterwards it should run pretty fast.

@ianlancetaylor