Repository navigation
How Loadwise found two database lookups per group member in Outline #1252
IbrahimHafez1
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When you remove a group from a collection in Outline, a background job notifies the affected users. The job already read group members in batches of 100. Inside each batch it still fetched the collection and the user separately for each member, so a full batch could make 200 lookups in that loop.
I maintain Loadwise and found the loop while running its JavaScript and TypeScript performance checker. Outline merged a fix that batches those lookups. The report points to the original loop and gives the steps to reproduce the query pattern. Original report · Merged fix
To try the same read-only checker, run this from your project root with a
tsconfig.jsonorjsconfig.json.If it finds something in your code, which result would you fix first? If it flagged something you'd leave alone, a rule ID and a sentence about the surrounding code would help me see what the checker missed.
All reactions