kitware-resonant / dkc-next

Apache License 2.0
3 stars 0 forks source link

Optimize anonymous user tree access #184

Closed zachmullen closed 3 years ago

zachmullen commented 3 years ago

This brought the time of listing 7 folders from ~3 sec to around ~250ms in the anonymous user case. This was a simple matter of not correctly detecting anonymous users, for which we have an optimized path.

Let's merge this and I'll follow up with other optimizations in other PRs.

zachmullen commented 3 years ago

@jbeezley would it make more sense to change the accepted type from Optional[User] to just User? Then we could force there to be a 'user' field in the serializer context.

EDIT: I've convinced myself that I should do that.

brianhelba commented 3 years ago

would it make more sense to change the accepted type from Optional[User] to just User?

Good idea. If user isn't in the context, let it die immediately at runtime.