- Notifications
You must be signed in to change notification settings - Fork925
Closed
Description
Problem
On dev.coder.com I noticed the/api/v2/workspaces
endpoint is slow when querying all. Upon doing approf
, it became apparent our authentication code is the primary cause of this:
This is requesting 85 workspaces, and the request took ~180ms (of which ~170ms seems to be auth code).
Here is a direct download to the pprof. You can view it yourself with:go tool pprof -http=:8080 <downloaded file>
.
Definition of Done
I'd suggest we write benchmarks for this code. Ideally it takes significantly less than 1ms to authorize a single RBAC object.