Context.getAuthenticatedUser is called often by RequiredDataAdvice to set audit fields like creator, retiredBy, etc... It is very slow when executed in a daemon thread as it fetches the user by uuid from the database each time. It must be cached similarly to other authenticated users.
This fix provides a significant performance improvement for any tasks ran in Daemon threads. It cuts the time of import through the open concept lab module by half from 8 hours to 4 hours on my machine.