[TASKMGMT-28] Avoid creating User throwaway objects in TaskManager API Created: 01/Jun/17  Updated: 05/Jan/18

Status: Accepted
Project: Task Management
Component/s: None
Affects Version/s: 1.2.2
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Federico Grilli Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: performance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MAGNOLIA-7028 MgnlUser bean consistency Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

Upon logging into AdminCentral, when Pulse initialises, the following method gets called several times
getTasksAmountByUserAndStatus:192, DefaultTasksManager (info.magnolia.task)
which, in turn, triggers
getUser:264, MgnlUserManager (info.magnolia.cms.security).
This results in the same user instance being created like 10 times.
Probably not much of a overhead and in any case the instance is local to a method so it will be thrown away immediately, still there could be room for some improvement.

Could be probably fixed if the TaskMgmt API would pass around the User object instead of just the user id, but that's quite a change on its own. If we passed the User object to TaskManager - we would be able to re-use User from MgnlContext.


Generated at Mon Feb 12 11:02:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.